feat: Add region scoping support (#90) - #94
Conversation
Add region scoping for outgoing flood traffic, on top of the openhop-core 1.1.3 scoping primitives: - Add a "Region Scope" setting (Settings > Radio) that sets the dispatcher's persisted default scope for all flood packets. - Add per-channel region scopes, stored in channel_secrets and set from the channel context menu. A channel scope overrides the default and is marked authoritative via _flood_scope_applied. - Decode and show transport codes in the analyzer details panel. - Bump openhop-core to >=1.1.3 for scope_packet and default_flood_transport_key. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014Hbfq4Kjz416sWdncV1sip
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8f2f900470
ℹ️ 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".
| def set_channel_region_scope(self, channel_id: str, scope: str | None) -> None: | ||
| normalized = normalize_region_scope(scope) | ||
| if normalized is None: | ||
| self._channel_scopes.pop(channel_id, None) | ||
| else: | ||
| self._channel_scopes[channel_id] = normalized |
There was a problem hiding this comment.
Route mock group sends through the scoped session path
In MESHCORE_MOCK=1, setting a channel scope only updates _channel_scopes; MockMeshcoreClient.send_message() never reads that map or calls the newly extended MockOpenHopCoreSession.send_group_text(). Sending on the channel therefore emits no mock_group_message_tx carrying region_scope, so the documented mock workflow cannot exercise or verify the new production adapter path even though the mock session was updated specifically to expose it. Pass mock group sends through the session with the selected scope.
AGENTS.md reference: AGENTS.md:L114-L121
Useful? React with 👍 / 👎.
- region.py: validate that a region scope is ASCII and at most 64 characters, so a name openhop_core cannot hash never reaches the database - session.py: normalize inside the try, so an invalid stored scope cannot stop the radio from connecting - settings.py, messages.py: report an invalid scope instead of saving it - channel_db.py: upsert in add_channel so re-importing a secret keeps the channel's region_scope
Add region scoping for outgoing flood traffic, on top of the openhop-core 1.1.3 scoping primitives:
Closes #90