{"url":"https://api.github.com/repos/OpenCyphal/pycyphal/pulls/388","id":3901380442,"node_id":"PR_kwDOAjeFf87oilda","html_url":"https://github.com/OpenCyphal/pycyphal/pull/388","diff_url":"https://github.com/OpenCyphal/pycyphal/pull/388.diff","patch_url":"https://github.com/OpenCyphal/pycyphal/pull/388.patch","issue_url":"https://api.github.com/repos/OpenCyphal/pycyphal/issues/388","number":388,"state":"closed","locked":false,"title":"Big, beautiful CAN/UDP/core cleanup: dedup constants, fix TX/RX defects, harden node lifecycle","user":{"login":"pavel-kirienko","id":3298404,"node_id":"MDQ6VXNlcjMyOTg0MDQ=","avatar_url":"https://avatars.githubusercontent.com/u/3298404?v=4","gravatar_id":"","url":"https://api.github.com/users/pavel-kirienko","html_url":"https://github.com/pavel-kirienko","followers_url":"https://api.github.com/users/pavel-kirienko/followers","following_url":"https://api.github.com/users/pavel-kirienko/following{/other_user}","gists_url":"https://api.github.com/users/pavel-kirienko/gists{/gist_id}","starred_url":"https://api.github.com/users/pavel-kirienko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavel-kirienko/subscriptions","organizations_url":"https://api.github.com/users/pavel-kirienko/orgs","repos_url":"https://api.github.com/users/pavel-kirienko/repos","events_url":"https://api.github.com/users/pavel-kirienko/events{/privacy}","received_events_url":"https://api.github.com/users/pavel-kirienko/received_events","type":"User","user_view_type":"public","site_admin":false},"body":"## Folks, this is a BIG, BEAUTIFUL cleanup. Maybe the best cleanup this transport stack has ever seen.\n\nWe took the CAN, the UDP, and the core session layer — tremendous code, but it had problems, BAD problems — and we fixed them. Bigly. Nobody dedups constants like we do. Believe me.\n\n### The WINS (and there are so many wins)\n\n**Constants — we drained the swamp.** The 29-bit CAN ID mask was copy-pasted all over town. Four times! Sad. Now it lives in ONE place (`can/_interface.py`), with its 11-bit friend, and everybody imports from there. And that `socketcan` \"MTU\" of 16? That was never the MTU, folks — that was the frame-struct size wearing a disguise. We gave it an honest name and derived it from `struct.size`. No more fake numbers.\n\n**Correctness — we fixed the rigged behavior:**\n- **Redundant sends now WIN when they win.** UDP subject *and* unicast: if the transfer goes out on at least one interface, that's a SUCCESS — not a phony `ExceptionGroup` that makes you retry and send duplicates. Just like the CAN transport. Just like the reference. Tremendous.\n- **python-can TX retries keep their place in line.** They used to cut the line with the global counter — total chaos, out-of-order frames. Not anymore.\n- **socketcan never gets wedged again.** An oversized frame is dropped, honestly, with a `ValueError` — it does not silently kill the TX task. And the worker tasks now report their crashes instead of disappearing.\n- **The receive loop is UNKILLABLE.** A handler that raises? The loop keeps going. Strong borders.\n- **The node knows when it's closed.** No more using a closed node. No more late arrivals sneaking in. Detached sends are tracked. And a pending `async for` gets unblocked on close — nobody gets left hanging.\n- **Gossip names get VETTED at the border.** Garbage wire names — non-normalized, wildcards, homeful, pinned — do NOT get to become local topics. We check the papers.\n\n**Simplification — we cut the waste:** dead code GONE (`deadline_ns`, `data`, `_now_mono`, `send_scout`, `_arm_reorder_timeout`, `_Fragment.crc`), duplicate deadline checks collapsed, the ACK-window helper de-duplicated, python-can's twin retry branches merged. Smaller. Cleaner. Faster to read at 3am.\n\n### The REVIEW. Very thorough. The best people.\n\nWe ran a world-class review operation — Codex (xhigh) and Claude (ultrathink), fresh context, **three rounds**. They found THREE real defects I'd have shipped (the incomplete unicast fix, a weak name guard, and one hollow test that passed on broken code — disgraceful, now fixed). Every behavior change ships with a regression test that FAILS on the old code. That's how you do it.\n\nOne reviewer kept insisting on a \"fix\" to `on_gossip` name handling. We checked. Twice. It was a FALSE POSITIVE — those paths key on the hash, not the name, and the fix would've broken the intentional monitor diagnostics. We refuted it with the code and a wire-path test. We don't fix things that aren't broken.\n\n### The numbers don't lie\n\nFull `nox` is **GREEN** — Python 3.11, 3.12, 3.13, plus mypy, lint, and format. **657 tests passing.** No public API changes. Zero. \n\n20 files, +523 / −141. A clean, beautiful diff.\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n","created_at":"2026-06-19T22:46:28Z","updated_at":"2026-06-19T22:52:40Z","closed_at":"2026-06-19T22:52:38Z","merged_at":"2026-06-19T22:52:38Z","merge_commit_sha":"73718bbd71ba72c786d4f953f9b451b27f06e45d","assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/OpenCyphal/pycyphal/pulls/388/commits","review_comments_url":"https://api.github.com/repos/OpenCyphal/pycyphal/pulls/388/comments","review_comment_url":"https://api.github.com/repos/OpenCyphal/pycyphal/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenCyphal/pycyphal/issues/388/comments","statuses_url":"https://api.github.com/repos/OpenCyphal/pycyphal/statuses/f245678bf6da3d85f7c90623d087c5c90c4a4204","head":{"label":"OpenCyphal:dev","ref":"dev","sha":"f245678bf6da3d85f7c90623d087c5c90c4a4204","user":{"login":"OpenCyphal","id":10167381,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMTY3Mzgx","avatar_url":"https://avatars.githubusercontent.com/u/10167381?v=4","gravatar_id":"","url":"https://api.github.com/users/OpenCyphal","html_url":"https://github.com/OpenCyphal","followers_url":"https://api.github.com/users/OpenCyphal/followers","following_url":"https://api.github.com/users/OpenCyphal/following{/other_user}","gists_url":"https://api.github.com/users/OpenCyphal/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenCyphal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenCyphal/subscriptions","organizations_url":"https://api.github.com/users/OpenCyphal/orgs","repos_url":"https://api.github.com/users/OpenCyphal/repos","events_url":"https://api.github.com/users/OpenCyphal/events{/privacy}","received_events_url":"https://api.github.com/users/OpenCyphal/received_events","type":"Organization","user_view_type":"public","site_admin":false},"repo":{"id":37193087,"node_id":"MDEwOlJlcG9zaXRvcnkzNzE5MzA4Nw==","name":"pycyphal","full_name":"OpenCyphal/pycyphal","private":false,"owner":{"login":"OpenCyphal","id":10167381,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMTY3Mzgx","avatar_url":"https://avatars.githubusercontent.com/u/10167381?v=4","gravatar_id":"","url":"https://api.github.com/users/OpenCyphal","html_url":"https://github.com/OpenCyphal","followers_url":"https://api.github.com/users/OpenCyphal/followers","following_url":"https://api.github.com/users/OpenCyphal/following{/other_user}","gists_url":"https://api.github.com/users/OpenCyphal/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenCyphal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenCyphal/subscriptions","organizations_url":"https://api.github.com/users/OpenCyphal/orgs","repos_url":"https://api.github.com/users/OpenCyphal/repos","events_url":"https://api.github.com/users/OpenCyphal/events{/privacy}","received_events_url":"https://api.github.com/users/OpenCyphal/received_events","type":"Organization","user_view_type":"public","site_admin":false},"html_url":"https://github.com/OpenCyphal/pycyphal","description":"Python implementation of the Cyphal protocol stack.","fork":false,"url":"https://api.github.com/repos/OpenCyphal/pycyphal","forks_url":"https://api.github.com/repos/OpenCyphal/pycyphal/forks","keys_url":"https://api.github.com/repos/OpenCyphal/pycyphal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenCyphal/pycyphal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenCyphal/pycyphal/teams","hooks_url":"https://api.github.com/repos/OpenCyphal/pycyphal/hooks","issue_events_url":"https://api.github.com/repos/OpenCyphal/pycyphal/issues/events{/number}","events_url":"https://api.github.com/repos/OpenCyphal/pycyphal/events","assignees_url":"https://api.github.com/repos/OpenCyphal/pycyphal/assignees{/user}","branches_url":"https://api.github.com/repos/OpenCyphal/pycyphal/branches{/branch}","tags_url":"https://api.github.com/repos/OpenCyphal/pycyphal/tags","blobs_url":"https://api.github.com/repos/OpenCyphal/pycyphal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenCyphal/pycyphal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenCyphal/pycyphal/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenCyphal/pycyphal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenCyphal/pycyphal/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenCyphal/pycyphal/languages","stargazers_url":"https://api.github.com/repos/OpenCyphal/pycyphal/stargazers","contributors_url":"https://api.github.com/repos/OpenCyphal/pycyphal/contributors","subscribers_url":"https://api.github.com/repos/OpenCyphal/pycyphal/subscribers","subscription_url":"https://api.github.com/repos/OpenCyphal/pycyphal/subscription","commits_url":"https://api.github.com/repos/OpenCyphal/pycyphal/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenCyphal/pycyphal/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenCyphal/pycyphal/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenCyphal/pycyphal/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenCyphal/pycyphal/contents/{+path}","compare_url":"https://api.github.com/repos/OpenCyphal/pycyphal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenCyphal/pycyphal/merges","archive_url":"https://api.github.com/repos/OpenCyphal/pycyphal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenCyphal/pycyphal/downloads","issues_url":"https://api.github.com/repos/OpenCyphal/pycyphal/issues{/number}","pulls_url":"https://api.github.com/repos/OpenCyphal/pycyphal/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenCyphal/pycyphal/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenCyphal/pycyphal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenCyphal/pycyphal/labels{/name}","releases_url":"https://api.github.com/repos/OpenCyphal/pycyphal/releases{/id}","deployments_url":"https://api.github.com/repos/OpenCyphal/pycyphal/deployments","created_at":"2015-06-10T11:27:27Z","updated_at":"2026-07-10T14:56:00Z","pushed_at":"2026-07-10T14:56:30Z","git_url":"git://github.com/OpenCyphal/pycyphal.git","ssh_url":"git@github.com:OpenCyphal/pycyphal.git","clone_url":"https://github.com/OpenCyphal/pycyphal.git","svn_url":"https://github.com/OpenCyphal/pycyphal","homepage":"https://opencyphal.github.io/pycyphal","size":90496,"stargazers_count":139,"watchers_count":139,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"has_discussions":false,"forks_count":109,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":12,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"has_pull_requests":true,"pull_request_creation_policy":"all","topics":["aerospace","can","can-bus","communication-protocol","cross-platform","cyphal","development-tools","drones","hacktoberfest","linux","opencyphal","python","python-3","python3","robotics","socketcan","space","uav","uavcan"],"visibility":"public","forks":109,"open_issues":12,"watchers":139,"default_branch":"master"}},"base":{"label":"OpenCyphal:master","ref":"master","sha":"752c736edacee9f97e6187949c8658822b7a03c1","user":{"login":"OpenCyphal","id":10167381,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMTY3Mzgx","avatar_url":"https://avatars.githubusercontent.com/u/10167381?v=4","gravatar_id":"","url":"https://api.github.com/users/OpenCyphal","html_url":"https://github.com/OpenCyphal","followers_url":"https://api.github.com/users/OpenCyphal/followers","following_url":"https://api.github.com/users/OpenCyphal/following{/other_user}","gists_url":"https://api.github.com/users/OpenCyphal/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenCyphal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenCyphal/subscriptions","organizations_url":"https://api.github.com/users/OpenCyphal/orgs","repos_url":"https://api.github.com/users/OpenCyphal/repos","events_url":"https://api.github.com/users/OpenCyphal/events{/privacy}","received_events_url":"https://api.github.com/users/OpenCyphal/received_events","type":"Organization","user_view_type":"public","site_admin":false},"repo":{"id":37193087,"node_id":"MDEwOlJlcG9zaXRvcnkzNzE5MzA4Nw==","name":"pycyphal","full_name":"OpenCyphal/pycyphal","private":false,"owner":{"login":"OpenCyphal","id":10167381,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMTY3Mzgx","avatar_url":"https://avatars.githubusercontent.com/u/10167381?v=4","gravatar_id":"","url":"https://api.github.com/users/OpenCyphal","html_url":"https://github.com/OpenCyphal","followers_url":"https://api.github.com/users/OpenCyphal/followers","following_url":"https://api.github.com/users/OpenCyphal/following{/other_user}","gists_url":"https://api.github.com/users/OpenCyphal/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenCyphal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenCyphal/subscriptions","organizations_url":"https://api.github.com/users/OpenCyphal/orgs","repos_url":"https://api.github.com/users/OpenCyphal/repos","events_url":"https://api.github.com/users/OpenCyphal/events{/privacy}","received_events_url":"https://api.github.com/users/OpenCyphal/received_events","type":"Organization","user_view_type":"public","site_admin":false},"html_url":"https://github.com/OpenCyphal/pycyphal","description":"Python implementation of the Cyphal protocol stack.","fork":false,"url":"https://api.github.com/repos/OpenCyphal/pycyphal","forks_url":"https://api.github.com/repos/OpenCyphal/pycyphal/forks","keys_url":"https://api.github.com/repos/OpenCyphal/pycyphal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenCyphal/pycyphal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenCyphal/pycyphal/teams","hooks_url":"https://api.github.com/repos/OpenCyphal/pycyphal/hooks","issue_events_url":"https://api.github.com/repos/OpenCyphal/pycyphal/issues/events{/number}","events_url":"https://api.github.com/repos/OpenCyphal/pycyphal/events","assignees_url":"https://api.github.com/repos/OpenCyphal/pycyphal/assignees{/user}","branches_url":"https://api.github.com/repos/OpenCyphal/pycyphal/branches{/branch}","tags_url":"https://api.github.com/repos/OpenCyphal/pycyphal/tags","blobs_url":"https://api.github.com/repos/OpenCyphal/pycyphal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenCyphal/pycyphal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenCyphal/pycyphal/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenCyphal/pycyphal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenCyphal/pycyphal/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenCyphal/pycyphal/languages","stargazers_url":"https://api.github.com/repos/OpenCyphal/pycyphal/stargazers","contributors_url":"https://api.github.com/repos/OpenCyphal/pycyphal/contributors","subscribers_url":"https://api.github.com/repos/OpenCyphal/pycyphal/subscribers","subscription_url":"https://api.github.com/repos/OpenCyphal/pycyphal/subscription","commits_url":"https://api.github.com/repos/OpenCyphal/pycyphal/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenCyphal/pycyphal/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenCyphal/pycyphal/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenCyphal/pycyphal/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenCyphal/pycyphal/contents/{+path}","compare_url":"https://api.github.com/repos/OpenCyphal/pycyphal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenCyphal/pycyphal/merges","archive_url":"https://api.github.com/repos/OpenCyphal/pycyphal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenCyphal/pycyphal/downloads","issues_url":"https://api.github.com/repos/OpenCyphal/pycyphal/issues{/number}","pulls_url":"https://api.github.com/repos/OpenCyphal/pycyphal/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenCyphal/pycyphal/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenCyphal/pycyphal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenCyphal/pycyphal/labels{/name}","releases_url":"https://api.github.com/repos/OpenCyphal/pycyphal/releases{/id}","deployments_url":"https://api.github.com/repos/OpenCyphal/pycyphal/deployments","created_at":"2015-06-10T11:27:27Z","updated_at":"2026-07-10T14:56:00Z","pushed_at":"2026-07-10T14:56:30Z","git_url":"git://github.com/OpenCyphal/pycyphal.git","ssh_url":"git@github.com:OpenCyphal/pycyphal.git","clone_url":"https://github.com/OpenCyphal/pycyphal.git","svn_url":"https://github.com/OpenCyphal/pycyphal","homepage":"https://opencyphal.github.io/pycyphal","size":90496,"stargazers_count":139,"watchers_count":139,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"has_discussions":false,"forks_count":109,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":12,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"has_pull_requests":true,"pull_request_creation_policy":"all","topics":["aerospace","can","can-bus","communication-protocol","cross-platform","cyphal","development-tools","drones","hacktoberfest","linux","opencyphal","python","python-3","python3","robotics","socketcan","space","uav","uavcan"],"visibility":"public","forks":109,"open_issues":12,"watchers":139,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenCyphal/pycyphal/pulls/388"},"html":{"href":"https://github.com/OpenCyphal/pycyphal/pull/388"},"issue":{"href":"https://api.github.com/repos/OpenCyphal/pycyphal/issues/388"},"comments":{"href":"https://api.github.com/repos/OpenCyphal/pycyphal/issues/388/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenCyphal/pycyphal/pulls/388/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenCyphal/pycyphal/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenCyphal/pycyphal/pulls/388/commits"},"statuses":{"href":"https://api.github.com/repos/OpenCyphal/pycyphal/statuses/f245678bf6da3d85f7c90623d087c5c90c4a4204"}},"author_association":"MEMBER","auto_merge":null,"assignee":null,"active_lock_reason":null,"merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"pavel-kirienko","id":3298404,"node_id":"MDQ6VXNlcjMyOTg0MDQ=","avatar_url":"https://avatars.githubusercontent.com/u/3298404?v=4","gravatar_id":"","url":"https://api.github.com/users/pavel-kirienko","html_url":"https://github.com/pavel-kirienko","followers_url":"https://api.github.com/users/pavel-kirienko/followers","following_url":"https://api.github.com/users/pavel-kirienko/following{/other_user}","gists_url":"https://api.github.com/users/pavel-kirienko/gists{/gist_id}","starred_url":"https://api.github.com/users/pavel-kirienko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavel-kirienko/subscriptions","organizations_url":"https://api.github.com/users/pavel-kirienko/orgs","repos_url":"https://api.github.com/users/pavel-kirienko/repos","events_url":"https://api.github.com/users/pavel-kirienko/events{/privacy}","received_events_url":"https://api.github.com/users/pavel-kirienko/received_events","type":"User","user_view_type":"public","site_admin":false},"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":2,"additions":524,"deletions":142,"changed_files":21}