You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
area: coredutagent server, RPC, config and backend internalscode healthInternal refactoring, tech debt and maintainabilityneeds designNeeds a design discussion or decision before work starts
Like when the dutcl prompt is <devname> <cmdname> help make sure there are no conflicts with namings configured in the dutagent configuration. This information must also be named in the module interface documentation, as a module could not expect any of these keywords as their first argument.
In the future there can also be more keywords like help applying to commands and keywords applying to devices like e.g. <devname> description, so make them maintained in a single place inside the codebase.
help in <device> <command> help is a reserved word with no enforcement: a dutagent config can today name a command help and shadow it. Planned future keywords ( description, etc.) make this worse — drift between dispatch, server validation, and module docs is inevitable.
Plan
Hybrid registry. Two layers, no import cycle.
pkg/dut/reserved.go — passive list of names, dependency-free:
var CommandKeywords = []CommandKeyword{{Name: "help", Description: "..."}}
var DeviceKeywords = []DeviceKeyword{}
var ErrReservedName = errors.New("name is reserved")
cmds/dutctl - dispatch table keyed by the same names, with an init() check that every reserved name has a handler. Replaces the hard-coded cmdArgs[0] == "help".
cmds/dutagent/config.go - reject configs whose device or command names collide with the reserved lists. Surfaces dut.ErrReservedName at startup.
pkg/module/module.go - doc note: modules must not expect a reserved keyword as their first argument.
Adding a future keyword
Append to pkg/dut/reserved.go.
Add handler in dutctl.
init() guarantees you didn't forget step 2; dutagent validation and module docs cover themselves.
area: coredutagent server, RPC, config and backend internalscode healthInternal refactoring, tech debt and maintainabilityneeds designNeeds a design discussion or decision before work starts
Activity
RiSKeD commentedon May 13, 2026
Reserved-keyword registry
Problem
helpin<device> <command> helpis a reserved word with no enforcement: a dutagent config can today name a command help and shadow it. Planned future keywords ( description, etc.) make this worse — drift between dispatch, server validation, and module docs is inevitable.Plan
Hybrid registry. Two layers, no import cycle.
pkg/dut/reserved.go — passive list of names, dependency-free:
cmds/dutctl- dispatch table keyed by the same names, with an init() check that every reserved name has a handler. Replaces the hard-coded cmdArgs[0] == "help".cmds/dutagent/config.go- reject configs whose device or command names collide with the reserved lists. Surfaces dut.ErrReservedName at startup.pkg/module/module.go- doc note: modules must not expect a reserved keyword as their first argument.Adding a future keyword
init()guarantees you didn't forget step 2; dutagent validation and module docs cover themselves.