Repository navigation
feat: resolve CDD execution rules into literal state references - #55
#55Merged
Merged
Conversation
Resolve explicit instance mayBeExec lists against the one-based state catalog in document order. Keep locked states literal, preserve source and group identities, and retain one alternative per bound service. Repeated references within a list produce one state entry. No states listed for a group does not establish ECU permission. Keep raw attributes and Err for unsupported rules, including empty exclusions and template rules even when an instance rule also exists. Validate the whole list before exposing resolved states. Unknown rules leave codecs and sibling services usable and produce one diagnostic on the accepted DID. The flattened index reading is supported empirically by the public Vector example in cantools at f74f76888d2c88329266b33947aa6ea534ddd213 (tests/files/cdd/example-diddatarefs.cdd: 25 states, references through 25) and the reported production-file check (12 states, 335 rules). The private file was not independently checked here. This evidence does not establish omitted-group semantics, template precedence or UDS access policy. Keep the API contract in Go documentation. Cover literal locked states, source identity and order, equivalent alternatives, unsupported rules and codec isolation. Validation: go test -race ./..., go vet ./..., gofmt -l ., git diff --check, and parsing the two public cantools CDDs.
Owner
Author
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit c934ae7. Configure here.
tomrford
added a commit
that referenced
this pull request
Sep 5, 2026
TestSendAndReceivePairedLinks compared live capture.End() snapshots while other virtual buses were still recording RX copies, which made main CI flake after #55. Co-authored-by: Cursor Agent <cursoragent@cursor.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
2F45
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.
Explicit CDD execution rules currently remain unknown even when they list states that the parser can identify. Resolve instance
mayBeExeclists into literalSessionsandSecurityLevelsstate references. For example, a list that names only the locked security state retains that state and leaves the session list empty; it does not imply ECU permission.Resolve one-based references across all declared state groups, preserve state and service identities, and keep one alternative per bound service. Return states in document order with repeated references removed within each list. The index interpretation has empirical support from the public Vector example, which declares 25 states and references through 25, and a reported production-file check. The private file was not independently validated here.
Malformed or empty lists, unsupported groups, exclusion attributes (including empty values), and template rules retain raw metadata and
Err. Template rules remain unknown even when an instance also declares a list: instance precedence for this attribute is not yet established. These errors leave codecs and sibling service alternatives usable. Omitted groups and locked states receive no inferred UDS access policy.Validation:
go test -race ./...,go vet ./...,gofmt -l ., andgit diff --checkpassed. Both public cantools CDD examples parse successfully. Tests cover literal locked states, source identity and order, equivalent alternatives, and codec isolation when a rule is unknown.Note
Medium Risk
Changes diagnostic precondition semantics and adds resolved state lists that downstream callers may rely on for UDS access decisions, though unsupported rule forms still fail closed with errors.
Overview
The CDD parser stops treating every execution rule as unknown and now resolves instance
mayBeExeclists intoPrecondition.SessionsandPrecondition.SecurityLevelsslices of literalStatevalues.Indexes are interpreted as one-based positions across all declared states (including unsupported groups), matching Vector-style documents. Referenced states are returned in document order with duplicates removed, split by
sessionvssecuritygroup; an empty side means nothing was listed for that group, not that access is allowed.notExecInStateGroups, templatemayBeExec, malformed/empty lists, out-of-range indexes, and states outside session/security still setErrand leave resolved lists nil, while raw attribute pointers and sibling service alternatives (and codecs) stay usable.Reviewed by Cursor Bugbot for commit c934ae7. Configure here.