From 9e7b75bb0f6f6649fb00f2dc97059e90b7d52875 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Sat, 19 Sep 2026 14:39:38 +0200 Subject: style: the 98 ruff could not fix, so the linter is a signal again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The pass before this applied ruff's own fixes. These are the ones needing a decision, and the point of doing them is that `ruff check .` now passes: a linter reporting 98 known-acceptable findings reports nothing, because the next real one arrives invisible. **Lines over 100 (70).** Mostly wrapped where they stood. Two exceptions: the aligned trailing comments in `protocol.py`'s message table were shortened rather than wrapped, because wrapping one row of a table breaks the table; and in `models.py` the column comments moved above their columns for the same reason. **Imports below the first statement (14).** `csam.py` kept its FastAPI imports under a section header halfway down the file; two node tests had a constant and a `pytestmark` wedged between two import blocks. Moved, not suppressed. **Bindings nothing reads (4).** Three in tests, where the call stays and only the name goes — `_user(client, "listener")` is there to create the user, not to return one. The fourth was in `revocation.py` and was not a lint finding at all: `_connect_and_listen` opened an httpx stream to the WebSocket URL, did `pass`, and then opened the real connection through the `websockets` library. One pointless request per connect, left over from before that library was used directly. Removed, and `httpx` with it. **`l` as a name (4)**, **semicolons (6)** in the POC spikes, and the rest. 2893 passed, the same count as the two commits before it. `meshbay_node/revocation.py` is worth a decision separately: 154 lines that nothing imports, superseded by `hub_client.maintain_ws`'s `on_revocation`. This commit only stopped it failing the linter. Co-Authored-By: Claude Opus 5 --- .../meshbay-common/src/meshbay_common/protocol.py | 27 +++++++++++----------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'packages/meshbay-common/src/meshbay_common') diff --git a/packages/meshbay-common/src/meshbay_common/protocol.py b/packages/meshbay-common/src/meshbay_common/protocol.py index d6e30e7..5374742 100644 --- a/packages/meshbay-common/src/meshbay_common/protocol.py +++ b/packages/meshbay-common/src/meshbay_common/protocol.py @@ -68,7 +68,8 @@ class MNP: # and no client: removed rather than repaired. # # Not a Double Ratchet message, and never was — finding C1 - # (`docs/MESHBAY_DESIGN.md` §13.1) rejected exactly that for groups. Since MNP 2.0 it is AES-256-GCM under a + # (`docs/MESHBAY_DESIGN.md` §13.1) rejected exactly that for groups. Since + # MNP 2.0 it is AES-256-GCM under a # per-device subkey of the group's chat epoch key, signed over the # ciphertext with the sending device's pinned Ed25519 key. There is no # plaintext form on the wire (`chatbox.py`, docs/MESHBAY_DESIGN.md §4.5); @@ -158,21 +159,21 @@ class MNP: MEMBER_UNPIN_ACK = "member_unpin_ack" APPS_ENABLED = "apps_enabled" # operator → node: which group apps to show APPS_ENABLED_ACK = "apps_enabled_ack" - TRANSFER_LIMITS = "transfer_limits" # operator → node: per-member caps for this group + TRANSFER_LIMITS = "transfer_limits" # operator → node: per-member caps here TRANSFER_LIMITS_ACK = "transfer_limits_ack" # node → this group: the new caps SET_SCAN_SETTINGS = "set_scan_settings" # operator → node: reconcile/debounce timing SET_SCAN_SETTINGS_ACK = "set_scan_settings_ack" MEDIA_META_REQ = "media_meta_req" # client → node: TMDB metadata for a path MEDIA_META_RESP = "media_meta_resp" # node → client: TMDB metadata (or none) - TMDB_CONFIG = "tmdb_config" # operator → node: set custom TMDB token/language (node-wide) - TMDB_CONFIG_ACK = "tmdb_config_ack" # node → everyone: new TMDB config (never the token) - TMDB_ENABLED = "tmdb_enabled" # operator → node: enable/disable TMDB for this group - TMDB_ENABLED_ACK = "tmdb_enabled_ack" # node → this group: new per-group TMDB enabled state - SEASON_META_REQ = "season_meta_req" # client → node: TMDB overview/poster for one season - SEASON_META_RESP = "season_meta_resp" # node → client: season-level TMDB fields (or none) - TMDB_SEARCH_REQ = "tmdb_search_req" # client → node: candidate TMDB matches for a query - TMDB_SEARCH_RESP = "tmdb_search_resp" # node → client: candidate list (id, title, year, poster) - TMDB_OVERRIDE = "tmdb_override" # operator → node: replace a show/movie's TMDB match + TMDB_CONFIG = "tmdb_config" # operator → node: token/language, node-wide + TMDB_CONFIG_ACK = "tmdb_config_ack" # node → everyone: config, never the token + TMDB_ENABLED = "tmdb_enabled" # operator → node: TMDB on/off here + TMDB_ENABLED_ACK = "tmdb_enabled_ack" # node → this group: TMDB on/off here + SEASON_META_REQ = "season_meta_req" # client → node: one season's overview + SEASON_META_RESP = "season_meta_resp" # node → client: season fields, or none + TMDB_SEARCH_REQ = "tmdb_search_req" # client → node: candidates for a query + TMDB_SEARCH_RESP = "tmdb_search_resp" # node → client: id, title, year, poster + TMDB_OVERRIDE = "tmdb_override" # operator → node: replace a match TMDB_OVERRIDE_ACK = "tmdb_override_ack" TMDB_REMATCH = "tmdb_rematch" # operator → node: drop one file's match TMDB_REMATCH_ACK = "tmdb_rematch_ack" @@ -255,7 +256,7 @@ class MNP: # key without having to reconnect. CHAT_EPOCH = "chat_epoch" CHAT_EPOCH_ACK = "chat_epoch_ack" - ROOT_UPDATE = "root_update" # operator → node: change writable/removable on a root + ROOT_UPDATE = "root_update" # operator → node: a root's flags ROOT_UPDATE_ACK = "root_update_ack" ROOT_EJECT = "root_eject" # operator → node: mark removable root as ejected ROOT_EJECT_ACK = "root_eject_ack" @@ -269,7 +270,7 @@ class MNP: # node's `sender_id` (Tier 2, docs/MESHBAY_DESIGN.md §3.3). GROUP_ROSTER_REQ = "group_roster_req" GROUP_ROSTER_RESP = "group_roster_resp" - ROSTER_READ = "roster_read" # operator → node: list pinned identities + members + ROSTER_READ = "roster_read" # operator → node: identities + members ROSTER_READ_ACK = "roster_read_ack" DENYLIST_READ = "denylist_read" # operator → node: show denylist entries DENYLIST_READ_ACK = "denylist_read_ack" -- cgit v1.2.3