Proposal 0014: handler-level argument introspection#14
Open
jimsynz wants to merge 1 commit into
Open
Conversation
Optional `c:BB.Command.arguments/0` callback so command handlers can advertise their goal-map schema directly. Consumers' DSL `argument` blocks remain authoritative — they can override or augment what the handler exposes — so existing robots are unaffected. Motivated by the `bb_examples` work, where the same three demo command handlers (Home, MoveToPose, DemoCircle) get registered in every consumer's robot DSL, each one redeclaring the same six-or-so argument declarations. With handler-level introspection the consumer just writes `handler …`, allowed_states …` and the schema flows through.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Optional
c:BB.Command.arguments/0callback so command handlers can advertisetheir goal-map schema directly to the runtime, the LiveView dashboard, and any
other DSL-introspection-driven consumer.
DSL
argumentdeclarations on the consumer side remain authoritative — theyoverride or augment whatever the handler exposes — so existing robots stay
exactly as they are.
Why now
bb_examples/arm_commandsships three demo command handlers (Home,MoveToPose, DemoCircle) for reuse across robots. Each consumer that
registers these handlers has to redeclare the same five-or-six
argumentblocks per command in their own
commands doblock. The duplicationproblem grows with each shared handler added.
Concrete examples are in the proposal body, plus discussion of merge
precedence, validation of the callback's return value, and a
Won't Havesection noting goal-map validation is a separate concern.Renders cleanly, REUSE-compliant.