Skip to content

feat: Add region scoping support (#90) - #94

Merged
cwill747 merged 2 commits into
mainfrom
region-scoping
Sep 10, 2026
Merged

cwill747 merged 2 commits into
mainfrom
region-scoping

Conversation

@cwill747

@cwill747 cwill747 commented Sep 10, 2026

Copy link
Copy Markdown
Owner

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.

Closes #90

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

@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: 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".

Comment thread src/meshcore_console/meshcore/region.py
Comment thread src/meshcore_console/meshcore/channel_db.py
Comment on lines +121 to +126
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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
@cwill747
cwill747 merged commit fad29a0 into main Sep 10, 2026
8 of 9 checks passed
@cwill747
cwill747 deleted the region-scoping branch September 10, 2026 02:38
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.

Region scoping support?

1 participant