Skip to content

docs(canopen): say when a bound device description may be edited in place - #300

Merged
dborgards merged 3 commits into
mainfrom
docs/canopen-bound-description-edits
Oct 12, 2026
Merged

dborgards merged 3 commits into
mainfrom
docs/canopen-bound-description-edits

Conversation

@dborgards

@dborgards dborgards commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

What does this change?

Closes #296 by stating the rule as it stands (option c): a bound CanOpenDeviceDescription is the mutable EdsDcfNet model and every reader — the peer-SDO gate on each SDO call, the loader, the foreign PDO and SRDO observers, a safety transaction's one reading at its start — enumerates it without synchronization. So a bound description is edited in place only while no call that reads it is running; an edit during one is unsupported and what that call sees is not specified: an enumerating reader (the loader, a safety transaction's reading) may fail with the dictionary's InvalidOperationException, reported as that call's own failure; a reader with single lookups around its own awaits (the observers' file fallback, the gate's Contains) may answer from a part-old, part-new description or find no match, with no error. (The first commit promised a loud failure for every case; Codex's finding corrected that, second commit.) README (§SDO client and a peer's device description, §Configuring a peer), the XML docs of CanOpenDeviceDescription.Objects and BindPeerDeviceDescription, and FR-CO-029 say so.

Option (b), a library-owned lock with an Edit method, is rejected: it covers only the readers, a writer reaching Objects bypasses it. Option (a), an immutable description (edit, then bind again), is the lasting fix but a breaking change: filed as #299 for the next major.

No code change. The gate was run anyway because XML docs are compiled under -p:CI=true.

Type of change

  • feat — new behaviour (minor release)
  • fix / perf — bug or performance fix (patch release)
  • docs / test / refactor / chore / ci — no release
  • Breaking change (! in the title, plus a BREAKING CHANGE: footer explaining the migration)

Checklist

  • dotnet build CanKit.Pro.sln -c Release succeeds (-p:CI=true, 0 warnings)
  • dotnet test CanKit.Pro.sln -c Release passes (net10.0: 1884 tests; dotnet format --verify-no-changes clean; pack + verify-packages.py ok; requirements traceability 0 new untraced)
  • Public API changes are documented with XML comments (no API change; docs only)
  • New behaviour is covered by a test (no new behaviour)
  • The requirement or ADR this relates to is referenced: FR-CO-029

🤖 Generated with Claude Code

…lace

A bound CanOpenDeviceDescription is the mutable EdsDcfNet model, and
every reader of it - the peer-SDO gate on each SDO call, the loader,
the foreign PDO and SRDO observers, a safety transaction's reading at
its start - enumerates it without synchronization. The README said a
bound instance may be edited in place and that the edit is seen from
the next call, but not that a structural edit during one of those
readings fails that call. #296.

Decision (option c of #296): the rule stands and is stated - edit a
bound description only while no call that reads it is running; a
structural edit during one fails that call with the dictionary's
InvalidOperationException, reported as the call's own failure, never a
silent wrong reading. README (SDO client, configuring a peer), the
Objects and BindPeerDeviceDescription XML docs and FR-CO-029 say so.
An immutable description, edit then bind again, is #299 for the next
major.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@cursor

cursor Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Documentation-only; no code or API contract changes beyond clarified XML comments.

Overview
Documents when a bound peer CanOpenDeviceDescription may be edited in place (closes #296): Objects is the mutable EdsDcfNet model, readers (peer-SDO gate, loader, foreign PDO/SRDO observers, safety transactions) read it without synchronization, so callers should edit only while no such call is in flight.

The docs spell out unsupported concurrent-edit behavior—enumerating readers may hit InvalidOperationException; lookup-based readers may see a torn view or miss entries silently—and note immutable descriptions as the planned next-major shape (#299). Updates land in FR-CO-029, package README (SDO client + peer safety snapshot caveat), and XML on CanOpenDeviceDescription.Objects and BindPeerDeviceDescription. No runtime behavior change.

Reviewed by Cursor Bugbot for commit a83b33c. Bugbot is set up for automated code reviews on this repo. Configure here.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T12:05:13.602604Z a83b33c Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bf1816b7a8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/CanKit.Pro.CANopen/README.md Outdated
@codecov

codecov Bot commented Oct 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

…upported, not loud

bf1816b promised that a structural edit during a reading always fails
that reading with the dictionary's InvalidOperationException. Codex:
only an enumerating reader (the loader, a safety transaction's
reading) can fail that way; the observers' file fallback and the
gate's Contains look objects up one at a time around their own awaits,
so an edit between two lookups gives a part-old, part-new reading or
no match, with no error - and a Dictionary read concurrent with a
write is unspecified anyway. README, the Objects XML doc and FR-CO-029
now say the edit is unsupported and what the call sees is unspecified,
naming both outcomes. The rule itself is unchanged: edit only while no
reading call runs.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b017d76f50

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/CanKit.Pro.CANopen/README.md Outdated
…e boot section says

b017d76 gave "a boot halted at that slave" as the consequence of a
verification that failed on a concurrent edit. Codex: that is the
mandatory slave and the simultaneous start; an optional slave is
skipped and the boot goes on (OnSlaveVerified, and the README's own
boot-up section). The example now states the slave is not started and
points at that section for the rest.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@dborgards

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: a83b33cfe3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@dborgards
dborgards merged commit 83c25f4 into main Oct 12, 2026
15 checks passed
@dborgards
dborgards deleted the docs/canopen-bound-description-edits branch October 12, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CanOpenDeviceDescription: a bound description is read without synchronization against in-place structural edits

1 participant