Skip to content

docs(events): define signed event firmware OTA contract - #133

Draft
RCGV1 wants to merge 2 commits into
meshtastic:masterfrom
RCGV1:codex/event-ota-contract
Draft

docs(events): define signed event firmware OTA contract#133
RCGV1 wants to merge 2 commits into
meshtastic:masterfrom
RCGV1:codex/event-ota-contract

Conversation

@RCGV1

@RCGV1 RCGV1 commented Jul 29, 2026

Copy link
Copy Markdown
Member

Status

Warning

This contract is currently untested with a physical event-firmware OTA round trip. It is a draft for cross-platform, security, and release-infrastructure review.

Summary

  • Separates executable firmware authorization from the display-oriented event manifest.
  • Defines an Ed25519-signed schema-v1 contract with exact device targeting, immutable artifact URLs, SHA-256, byte counts, source-version floors, and explicit return-to-standard artifacts.
  • Defines ESP32 application-partition and nRF bootloader compatibility gates.
  • Requires clients to fall back to flasher.meshtastic.org whenever compatibility or trust cannot be proven.
  • Documents signing-key rotation, revocation, event setup, and the Apple draft implementation status.

Why

The existing event manifest can describe branding and link to a firmware bundle, but it cannot safely authorize an app to write executable bytes. All clients need one shared contract for release identity, trust, exact-target selection, integrity verification, and returning a node to standard firmware.

Validation

  • git diff --check
  • Reviewed against the current API event manifest and Apple draft installer behavior.
  • Physical event OTA validation is still pending.

Dependencies

Deployment Notes

The contract must not be activated until a project-owned Ed25519 release key is provisioned, its public key is shipped in clients, and every listed artifact has completed the hardware validation matrix.

Summary by CodeRabbit

  • Documentation
    • Added requirements for secure event firmware installation, including signed contracts, device compatibility checks, HTTPS artifact validation, and checksum verification.
    • Documented fallback to the web flasher when validation or download checks fail.
    • Expanded the process for adding events with immutable firmware artifacts and release-signing configuration.
    • Updated Apple platform status and added tasks for signing-key rotation and hardware validation.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@RCGV1, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 51 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8a414f1c-120b-40a0-aac2-36090f89052e

📥 Commits

Reviewing files that changed from the base of the PR and between 0458b31 and fc05e68.

📒 Files selected for processing (1)
  • .github/features/firmware-edition-event-behavior.md
📝 Walkthrough

Walkthrough

The event firmware specification adds signed OTA authorization, artifact compatibility and integrity checks, install-action gating, expanded event onboarding requirements, Apple platform status updates, and signing-key and hardware-validation tasks.

Changes

Event Firmware OTA

Layer / File(s) Summary
Signed OTA authorization contract
.github/features/firmware-edition-event-behavior.md
Defines Ed25519-signed, edition-scoped contracts, trusted artifact URL rules, compatibility validation, and byte-count/SHA-256 verification.
Installation workflow and rollout requirements
.github/features/firmware-edition-event-behavior.md
Adds install gating and pre-install steps, expands event onboarding instructions, updates Apple status, and adds signing-key and hardware-validation tasks.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant EventFirmwareInstaller
  participant SignedOTAContractService
  participant ArtifactHost
  participant ExistingOTADFU
  EventFirmwareInstaller->>SignedOTAContractService: Fetch and verify signed edition contract
  SignedOTAContractService-->>EventFirmwareInstaller: Return compatible artifact metadata
  EventFirmwareInstaller->>ArtifactHost: Download and verify artifact
  ArtifactHost-->>EventFirmwareInstaller: Return artifact bytes
  EventFirmwareInstaller->>ExistingOTADFU: Hand off verified firmware
Loading

Possibly related PRs

  • meshtastic/design#132: Updates the same event firmware behavior specification and its manifest trust rules.

Suggested reviewers: jamesarich

Poem

I’m a bunny with firmware to thump,
Signed contracts make downloads jump.
Hashes check right,
Origins stay bright,
Then OTA hops with a bump!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: defining a signed event firmware OTA contract in docs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@RCGV1

RCGV1 commented Jul 29, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai 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.

Actionable comments posted: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/features/firmware-edition-event-behavior.md:
- Around line 135-146: Update the production contract example so
standardArtifacts is non-empty and target-complete, or explicitly mark the
example as incomplete; ensure contract validation rejects empty
standardArtifacts and preserves the requirement for an explicit return artifact.
- Around line 334-338: Update the firmware edition event behavior sequence to
re-check device connection and identity immediately before invoking the existing
OTA/DFU flow. Abort when the device disconnects or its identity changes during
download, then revalidate the selected target before handing off the verified
artifact.
- Around line 86-115: Update the client validation for the signed contract to
require payload.edition to exactly match the requested {EDITION} path parameter
before allowing installation. Ensure contract cache entries are keyed by edition
so a valid response for one event cannot be reused for another.
- Around line 348-354: Update the existing-enum event OTA instructions to
require the API signing key’s public key to be pre-provisioned under a trusted
client keyId before enabling OTA. If the key is not already trusted by released
clients, explicitly require shipping a client release containing it before
adding the eventFirmwareOTA.json entry.
- Around line 148-158: Update the artifact-selection contract to explicitly
require non-null `dfuProtocol` and `minimumBootloaderVersion` for nRF52
artifacts, and valid exact `partitionRole` and `partitionScheme` values for
ESP32 artifacts. State that missing or null architecture-specific fields reject
the artifact before compatibility checks.
- Around line 139-150: Define the source-version compatibility contract before
the minimumSourceVersion requirement: specify the accepted version grammar, how
short versions and source-reference suffixes map to a comparable representation,
the comparison semantics, and the behavior for unsupported formats. Ensure
clients apply these rules consistently when enforcing minimumSourceVersion.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a037760b-599d-4099-9862-22b72a68e106

📥 Commits

Reviewing files that changed from the base of the PR and between 915c391 and 0458b31.

📒 Files selected for processing (1)
  • .github/features/firmware-edition-event-behavior.md

Comment thread .github/features/firmware-edition-event-behavior.md
Comment thread .github/features/firmware-edition-event-behavior.md Outdated
Comment thread .github/features/firmware-edition-event-behavior.md
Comment on lines +148 to +158
Selection is exact on `pioEnv`, `hwModel`, and `architecture`, with exactly one
matching artifact. The client also enforces `minimumSourceVersion` and
architecture-specific compatibility:

- ESP32 artifacts are bare application `.bin` payloads for `app0`, never
factory, merged, filesystem, or OTA-loader images. Their partition scheme
must exactly match the connected target.
- nRF52 artifacts are target-specific Nordic DFU OTA ZIPs. The contract names
the DFU protocol and minimum compatible bootloader. A client that cannot
establish the installed bootloader's compatibility must not offer in-app
DFU.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Make architecture-specific fields explicitly required.

For nRF52 artifacts, dfuProtocol and minimumBootloaderVersion must be present; for ESP32, partitionRole and partitionScheme must be valid and exact. The current text describes these requirements but does not state that missing or null fields cause rejection, allowing an incomplete signed artifact to reach compatibility checks without proof.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/features/firmware-edition-event-behavior.md around lines 148 - 158,
Update the artifact-selection contract to explicitly require non-null
`dfuProtocol` and `minimumBootloaderVersion` for nRF52 artifacts, and valid
exact `partitionRole` and `partitionScheme` values for ESP32 artifacts. State
that missing or null architecture-specific fields reject the artifact before
compatibility checks.

Comment thread .github/features/firmware-edition-event-behavior.md Outdated
Comment thread .github/features/firmware-edition-event-behavior.md Outdated
@RCGV1

RCGV1 commented Jul 29, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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.

1 participant