Repository navigation
firmware: add CV1 contributor checks that need no jig - #24354
Conversation
Add host checks, key-free application compilation, offline artifact preflight, startup replay, the OTA design docs and the owner OTA research code. None of it flashes, signs, publishes or changes device trust, and no firmware source changes: audio_packet_logic.c is a tested seam that is not linked until transport.c switches to it separately. Imported receipts and captures are labelled operator_supplied because the tools only check that their bytes are unchanged. Document that an opened board may have no antenna contact, since the mainboard relies on pogo pad PP1 and the BOM has no antenna part. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
CI runs clang-format 18 and newer releases format compound literals and casts differently, so avoid those constructs in the owner OTA research code. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
6 issues found and verified against the latest diff
Confidence score: 1/5
validation-model.mdidentifies a tracked PEM as an RSA private signing key, creating a serious signing-key custody risk. Remove it from release signing and history, and use a secret-managed production key.compile_only.pychecks application.configfor sysbuild-only settings, so normal compile-only runs stop before08-compile-app. Read theSB_CONFIG_*settings instead.bootstrap_matrix.pytreats a rejected downgrade like a torn-primary failure, which can prevent booting a valid current primary and leave the candidate intact. Keep the primary bootable when its version is valid and the candidate is older.checkout_contributor.pycan report the toolchain as pinned without verifying the CMake and Ninja executables the compile path launches. Verify those exact executables before reporting the toolchain as pinned.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="omi/firmware/docs/ota-bootstrap-contract.md">
<violation number="1" location="omi/firmware/docs/ota-bootstrap-contract.md:72">
P3: Add spaces between prose, numbers, units, and identifiers throughout this contract. For example, write `advertises 64 KiB`, `requires 4 KiB`, and `a 400 KiB caller request`; the same cleanup is needed in the RAM and HCI rows.</violation>
</file>
<file name="omi/firmware/docs/validation-model.md">
<violation number="1" location="omi/firmware/docs/validation-model.md:29">
P1: This paragraph understates the custody risk: the configured, tracked PEM is an RSA private signing key, not merely an unverified key path. Remove it from release signing and history, use a secret-managed production key, and explicitly mark this repository key as compromised/development-only before relying on MCUboot trust.</violation>
</file>
<file name="omi/firmware/tools/cv1/source_review/bootstrap_matrix.py">
<violation number="1" location="omi/firmware/tools/cv1/source_review/bootstrap_matrix.py:65">
P2: This branch conflates a rejected downgrade with the torn-primary hazard: a valid current primary must remain bootable and the candidate must remain intact when its version is lower. Return `primary` for a valid primary here, retaining the source-erased result only for an invalid torn primary.</violation>
</file>
<file name="omi/firmware/tools/cv1/compile_only.py">
<violation number="1" location="omi/firmware/tools/cv1/compile_only.py:53">
P1: This validation requires sysbuild-only settings from the application `.config`, so every normal compile-only run stops before `08-compile-app` with “lacks skip strategy” instead of compiling. Use `SB_CONFIG_*` in an actual sysbuild invocation, or remove these sysbuild-only requirements from the plain application-object check.</violation>
</file>
<file name="omi/firmware/tools/cv1/checkout_contributor.py">
<violation number="1" location="omi/firmware/tools/cv1/checkout_contributor.py:6">
P2: The documented `quick-host` command fails before running any checks when the pinned baseline object is not present in the checkout. Ship or require the baseline object, or pin a reachable baseline and document the required history; otherwise contributors receive a false failed prerequisite instead of host results.</violation>
<violation number="2" location="omi/firmware/tools/cv1/checkout_contributor.py:85">
P2: The toolchain stage can pass without verifying the CMake and Ninja executables that the compile path actually launches. Hash or resolve those exact `<toolchain_root>/bin` paths before reporting the toolchain as pinned; otherwise a changed link or file can silently select different build tooling.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
|
|
||
| ## Key custody and phone trust | ||
|
|
||
| The app key source is a tracked repository PEM path selected by product `omi/firmware/omi/sysbuild.conf`; only path existence was checked, never private bytes. This does not establish a production secret or custody. Network build defaults generate development-key material in a fresh build directory; SDK warns against production use. No inference is made about shipped devices or the erased factory application. |
There was a problem hiding this comment.
P1: This paragraph understates the custody risk: the configured, tracked PEM is an RSA private signing key, not merely an unverified key path. Remove it from release signing and history, use a secret-managed production key, and explicitly mark this repository key as compromised/development-only before relying on MCUboot trust.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At omi/firmware/docs/validation-model.md, line 29:
<comment>This paragraph understates the custody risk: the configured, tracked PEM is an RSA private signing key, not merely an unverified key path. Remove it from release signing and history, use a secret-managed production key, and explicitly mark this repository key as compromised/development-only before relying on MCUboot trust.</comment>
<file context>
@@ -0,0 +1,33 @@
+
+## Key custody and phone trust
+
+The app key source is a tracked repository PEM path selected by product `omi/firmware/omi/sysbuild.conf`; only path existence was checked, never private bytes. This does not establish a production secret or custody. Network build defaults generate development-key material in a fresh build directory; SDK warns against production use. No inference is made about shipped devices or the erased factory application.
+
+SMP transport has plain GATT read/write permissions in this baseline; encryption/authenticated SMP permissions are off. Pairing availability does not establish paired-only OTA authorization and does not replace boot signatures. A low-cost stable local/offline maintainer signer is a proposal; KMS can follow later. No new key has been created, and existing devices cannot be assumed to trust a new key without a migration design.
</file context>
| return records | ||
| def validate_config(text): | ||
| forbidden=['CONFIG_SECURE_BOOT=y','CONFIG_NCS_INCLUDE_RPMSG_CHILD_IMAGE=y','CONFIG_MCUBOOT_GENERATE_UNSIGNED_IMAGE=y','CONFIG_BUILD_OUTPUT_BIN=y','CONFIG_BUILD_OUTPUT_HEX=y','CONFIG_SIGN_IMAGES=y','CONFIG_MCUBOOT_BUILD_STRATEGY_FROM_SOURCE=y','CONFIG_BOOTLOADER_PROVISION_HEX=y'] | ||
| required=['CONFIG_BOOT_SIGNATURE_KEY_FILE=""','CONFIG_MCUBOOT_BUILD_STRATEGY_SKIP_BUILD=y'] |
There was a problem hiding this comment.
P1: This validation requires sysbuild-only settings from the application .config, so every normal compile-only run stops before 08-compile-app with “lacks skip strategy” instead of compiling. Use SB_CONFIG_* in an actual sysbuild invocation, or remove these sysbuild-only requirements from the plain application-object check.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At omi/firmware/tools/cv1/compile_only.py, line 53:
<comment>This validation requires sysbuild-only settings from the application `.config`, so every normal compile-only run stops before `08-compile-app` with “lacks skip strategy” instead of compiling. Use `SB_CONFIG_*` in an actual sysbuild invocation, or remove these sysbuild-only requirements from the plain application-object check.</comment>
<file context>
@@ -0,0 +1,107 @@
+ return records
+def validate_config(text):
+ forbidden=['CONFIG_SECURE_BOOT=y','CONFIG_NCS_INCLUDE_RPMSG_CHILD_IMAGE=y','CONFIG_MCUBOOT_GENERATE_UNSIGNED_IMAGE=y','CONFIG_BUILD_OUTPUT_BIN=y','CONFIG_BUILD_OUTPUT_HEX=y','CONFIG_SIGN_IMAGES=y','CONFIG_MCUBOOT_BUILD_STRATEGY_FROM_SOURCE=y','CONFIG_BOOTLOADER_PROVISION_HEX=y']
+ required=['CONFIG_BOOT_SIGNATURE_KEY_FILE=""','CONFIG_MCUBOOT_BUILD_STRATEGY_SKIP_BUILD=y']
+ if any(x in text.splitlines() for x in forbidden) or any(x not in text.splitlines() for x in required):raise ValueError('compile-only config enables image/key/child behavior or lacks skip strategy')
+def validate_commands(text):
</file context>
The repo's *.log ignore rule dropped two pinned startup fixtures, so quick-host failed on any clean checkout. Track them explicitly. Move the owner OTA research code to its own change: it isn't built, and it has known defects that shouldn't land under a contributor-checks title. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fix review findings in the contributor tools. Evidence and job checks now reject malformed or inconsistent input instead of passing or crashing. SDK checks reject stray files other than Python bytecode, which any used SDK has. Shallow clones get their own error, tested against real git. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The test compared Python tuples with JSON lists, so it could never pass when the pinned SDK was present. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Exercise the SDK tree-state and toolchain launch checks without mocks, and reject non-integer UART byte counts, which compared equal to real sizes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Disposition of all 53 Cubic findings on this PR, as of head Moved out, not fixed (20). Everything on Rejected (2), with evidence:
Left open, out of scope (1): Fixed (30):
The Later independent review of Verified on |
Requested by David
What changed and why
Adds checks a CV1 contributor can run without a jig: host tests, key-free application compilation, offline artifact preflight, and startup replay. Also adds the OTA design docs. The owner-OTA research code goes in a separate held change. No firmware behavior changes:
audio_packet_logic.cis a tested seam that is not linked untiltransport.cswitches to it in a separate change.Also documents a bench trap: the mainboard has no antenna part, so an opened board barely radiates and weak advertising from it is not a firmware fault.
Product invariants affected
Not changed in practice: the new
lib/coreseam is not linked into the firmware by this PR, so the capture path is unchanged. The change that links it needs its own BLE audio evidence.How it was verified
All on head
f322521, from a clean clone on the bench Mac, with no device access:python3 omi/firmware/tools/cv1/contributor.py quick-host --output <new-file>passes.python3 -m unittest discover -p 'test_*.py'inomi/firmware/tools/cv1: 191 tests pass.source_reviewtests: 14 pass with the pinned NCS 2.9.0 source, and skip cleanly without it.contributor.py compile-onlyagainst pinned NCS 2.9.0:application_compile_onlypasses.Not verified: none of this exercises hardware, BLE or a real OTA. No release claim is made.
Replaces #24353, whose first commit contained a telemetry fixture of unverifiable consent. Every Cubic finding is dispositioned in the PR comments. Findings on the research code move with it to its own held change.
Tests
The PR is mostly tests.
omi/tests/host/audio_packet_logic_test.ccovers the new seam.UI evidence
UI-Evidence: none -- firmware tooling and docs only
🤖 Generated with Claude Code