Add daw_field_type/v1 contract -- declarative field type definitions #3
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#3
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
Add
daw_field_type/v1as a new ecosystem-wide contract indaw-contracts, replacing the hardcoded field type list(
M.PRIMITIVES: text, textarea, number, boolean, select, date) inDAW/daw-modul-berhtjan-core#types.lua.A
daw_field_type/v1object describes a field type declaratively --its value semantics and the ways its value may be acquired -- so that
Core and any adapter (CLI, web, API) can handle a field type without
knowing its name in code. A new field type is introduced purely as
data; no change to Core or any adapter is required.
Background
M.PRIMITIVESindaw-modul-berhtjan-corehardcodes the six knownfield types directly in Lua code. Adding a new field type today
requires a code change and a release. This was identified as a
blocker during the 2.1
daw_error/v1migration ofdaw-modul-berhtjan-core(feature/daw-error-v1-migrationbranch)and traced back to the same anti-pattern described in
"Festgelegt heißt nicht einprogrammiert" -- a closed, fixed vocabulary
does not need to be hardcoded in program code, only the shape of the
contract does.
The proposed model was calibrated against real cases, not designed
up front:
select, date)
(
lattenzaun_orientation, as a deliberately unfamiliar test case)steurjan(receipts),raidjan(incoming invoices, bank statements)openbookregistercoverimages need both fresh upload and selection from an existing
library, producing the same reference value either way
resolved vocabulary)
Model summary
Key invariants:
acquisitionentries of the same field type must produce thesame value form.
value.cardinalityapplies to the field type as a whole, not peracquisition path.
constraintkey must not be silently treated assatisfied -- unlike
hint, which is safe to ignore when unknown.Full draft (contract.json, specification.md, rationale.md,
CHANGELOG.md, examples/valid + examples/invalid) is attached to this
issue / available in the linked session artifact -- ready to drop
into
daw_field_type/v1/followingTEMPLATE.md.Acceptance criteria
daw_field_type/v1/{contract.json,specification.md,rationale.md,CHANGELOG.md}added,status: draftexamples/valid/covers: text, textarea, unrecognized value.kind, multi-value tags, dual-acquisition cover imageexamples/invalid/covers: missing cardinality, selection without collection, unrecognized (closed) acquisition kinddaw-modul-berhtjan-core#types.luamigration (M.PRIMITIVESremoval) tracked as separate follow-up issue inDAW/daw-modul-berhtjan-core, referencing this oneOpen questions (not blocking, tracked for later)
(e.g. live signature capture, map-based location picking) -- not
yet worked through against a real case.
constraintkey vocabulary itself is unspecified in this version.Refs: DAW/daw-modul-berhtjan-core (M.PRIMITIVES blocker, feature/daw-error-v1-migration branch)
Resolved.
daw_field_type/v1 added: contract.json, specification.md,
rationale.md, CHANGELOG.md, examples/valid + examples/invalid,
status: draft. Calibrated against the six former berhtjan-core
primitives, a new domain-specific value kind (lattenzaun_orientation),
file/resource acquisition (steurjan, raidjan, openbookregister),
dual acquisition for one field type (cover image: upload or select
existing), and multi-value acquisition (tags).
Open/closed vocabulary decided per field: value.kind, resource.kind,
collection.capability, hint keys open; acquisition[].kind,
collection.source, value.cardinality, constraint keys (closed,
7-key set: min, max, step, integer_only, min_length, max_length,
pattern) closed.
Consumed in daw-modul-berhtjan-core 2.1.0 -- types.resolve() is now
pure registry lookup, M.PRIMITIVES removed entirely.
Refs: DAW/daw-modul-berhtjan-core#11