Him support2 - #554
Closed
UlfBj wants to merge 10 commits into
Closed
Conversation
Signed-off-by: Ulf Bjorkengren <ulfbjorkengren@geotab.com>
Signed-off-by: Ulf Bjorkengren <ulfbjn@gmail.com>
… type support Adds support for the three HIM (Hierarchical Information Model, https://github.com/COVESA/hierarchical_information_model) profiles in addition to the existing VSS/'vehicle-data' rule set: - 'vehicle-data' (default): branch/sensor/actuator/attribute/struct/property, identical to the pre-existing behavior. - 'data': branch/ro/rw/struct/property (HIM Data Rule Set). - 'service': branch/procedure/iostruct/symlink/attribute/struct/property (HIM Service Rule Set), including the 'Input'/'Output' iostruct naming rule, the mandatory procedure->attribute 'Version' parent/child relation, and the iostruct->property/symlink parent/child relation. Selected via a new top-level '--profile' option (vspec --profile <vehicle-data|data|service> export ...), defaulting to 'vehicle-data' so existing invocations are unaffected. Implementation: - model.py: new 'Profile' enum, 'PROFILE_ALLOWED_TYPES' map, and a 'active_profile' global (mirroring the existing dynamic_units/ dynamic_quantities pattern) checked by a new NodeType field validator. Adds VSSDataRo/VSSDataRw/VSSDataProcedure/VSSDataIostruct/VSSDataSymlink node data classes and wires them into TYPE_CLASS_MAP. - main.py: extends get_invalid_node_msgs() parent/child structural checks for the new node types. - cli.py/cli_options.py: new global '--profile' option, applied once in the root 'cli' group so all exporters inherit it without per-exporter changes. Also fixes a pre-existing bug where TYPE_CLASS_MAP mapped NodeType.ACTUATOR to VSSDataSensor instead of VSSDataActuator (harmless today since both classes were identical, but now that per-type validators exist this could otherwise silently apply the wrong ones).
…rofile
- tests/vspec/test_profiles/: end-to-end CLI tests (via subprocess, matching
existing test conventions) covering:
- default profile == 'vehicle-data' (no regression, byte-identical JSON output)
- happy path JSON export for each of the three profiles
- rejection of a node type from the wrong profile (sensor/actuator under
'data', ro/rw under 'vehicle-data', procedure/iostruct/symlink under
'vehicle-data')
- 'service' profile structural rules: iostruct must be named
Input/Output, symlink must have an iostruct parent
- --profile CLI choice validation (accepts the three valid names,
rejects an invalid one)
- docs/vspec_arch.md: new 'HIM Profiles' section explaining the three
profiles, their allowed node types, and the additional service-profile
structural rules; also lists '--profile' among the toplevel-only options.
- README.md: short 'HIM Profiles' usage blurb under 'Usage', linking to
the vspec_arch.md section.
…sessions Captures the background, implementation pointers, deliberate scope limitations, and verification approach for the 'him-support' branch's --profile feature, so future AI coding agent sessions (or humans) working in this repo have durable context without needing to re-derive it.
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.
No description provided.