feat(rules): module-has-adapters -- modules must declare M.adapters explicitly #125
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#125
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?
Background
DAW modules declare M.provides (capabilities) and M.adapters (which
adapters validate them). Currently M.adapters is optional -- if absent,
M.provides is used as the adapter name (backwards compatibility).
This works as long as capability name == adapter name (e.g. "ui" -> adapters/ui).
It breaks when they differ (e.g. "log-file" -> adapters/log).
Rule
Every installable module MUST declare M.adapters explicitly.
Using M.provides as adapter name is deprecated.
Enforcement
Two levels:
fragjan rule (ERROR): module declares provides but no adapters field.
This is a hard error -- module is incomplete.
core/modules/validator.lua (INFO log): module uses old schema
(no M.adapters declared). Logged once per module during validation.
Removed when all modules have been migrated.
fragjan rule
New rule in daw-lua-module pack:
Migration path
For existing modules (provides = { "ui" }):
For new modules with different capability/adapter names:
Known modules needing migration
All modules with provides = { "ui" } (berhtjan-cli, berhtjan-web, etc.)
All future modules where capability != adapter name.
Dependencies
Acceptance criteria
Design question: M.adapters declaration requirement
The rule needs to clarify whether M.adapters must always be declared explicitly,
or only when a module actually uses adapters.
Case: daw-modul-mainjan has no adapter dependency. The adapter finds the module
via contribution.json -- not via M.adapters. Same applies to other module-manager
style modules.
Questions to resolve before implementing the rule:
Related: DAW/daw-lua-mainjan (mainjan has no M.adapters in init.lua)