Preserve command provenance and reject command name collisions in build_index() #16
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#16
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
Preserve command provenance and reject command name collisions in
scanner/index.lua's build_index().
Background
Found while tracing the actual data flow for the #13 resource-scope
discussion (which module produced a given label_resource_id), not
caused by it and not dependent on it resolving first. Two independent
defects exist in build_index() today, on main as it stands:
module/contribution identity at all -- only label_resource_id,
default and subcommands. Only the subcommand level attaches
mod(the required Lua module table from entry.mod), which is a
different kind of provenance than composer.lua's contribution.module
string and is not present on the command entry itself.
index[cmd_name] = {...}unconditionally. If two contributionsdeclare a command with the same name, the later one silently
overwrites the earlier one -- no error, no warning, the first
command's definition (and whatever it carried) simply disappears.
The second point is a real defect independent of any i18n/resource
work:
Modul A: command "foo",Modul B: command "foo"silentlylosing one of them is not reasonable behaviour on its own.
Scope
identity, using the same stable identity composer.lua already uses
(contribution.module), not entry.mod.
overwrite the earlier entry; build_index() returns a structured
daw_error/v1 instead.
The existing contribution.module string is sufficient for this fix;
any richer provenance representation is DAW/daw-modul-berhtjan-core#13's
concern, not this issue's.
Acceptance criteria
(contribution.module), consistently with composer.lua's compose()
nil, daw_error/v1 (new resource_id, following the file's
existing fail() pattern) instead of silently overwriting
genuine collision is red before the fix and green after,
under Lua 5.1 and 5.4
Related
Found during DAW/daw-modul-berhtjan-core#13 (resource discovery/
collection design); fix this first, then continue #13 with both the
compose()/fields path and this build_index()/commands path on the
same provenance footing.