Feat/guardrail dict api#2
Merged
Merged
Conversation
Redesign the no-hardware filter API around a single keyed dict aligned with the runtime's step(): the reserved `action` key is the command to validate, every other key is an observation group injected into callbacks by name. This removes the old `guard(action, obs)` two-flat-vector shape that forced different-space embodiments (a mobile base observing [x,y,yaw] but commanding [v,omega]) to pack everything into one vector and slice it positionally. API (no compat shim): - SafetyGuard -> Guardrail, safe() -> guardrail(), SafetyProcessorStep -> GuardrailProcessorStep - Guardrail prints its obs/action contract on construction and fails fast when an input dict omits a required obs group or shadows a reserved runtime key - safe_action on reject: explicit vector / "hold" (arm default) / "zero" Mechanics: - Observation.channels + images are flattened into the runtime pool so a callback can declare `base_pose`/`current` and receive it directly - Observation.joint_positions defaults to an empty array (a mobile base has none) - ActionProposal duck-types as its command vector (__array__/__iter__/...) so callbacks can write `v, omega = action` while builtins keep .target_joint_positions - @dam.callback gains `layer=`, setting _cb_layer so custom filter callbacks are dispatched by the matching L-guard Also folds in the 0.7.0 semantics cleanup: remove JointLayout/chains (action_layout is the single named-segment contract), drop the fallback `type` field, replace register_solver_factory with the @dam.solver_factory decorator + keyword injection, and bump to 0.7.0. New example mobile_base_guardrail.py (~55 lines) replaces a 180-line wrapper. Docs + release notes updated; 721 unit tests pass, mypy + docs-check clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
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.




Summary
Briefly describe the changes and the problem they solve.
Linked Issues
Fixes # (issue number)
Testing
Checklist