Skip to content

gate GET_BODY_LOCATION_AND_STATUS on cmd_status - #61

Merged
abdulsaheel merged 1 commit into
mainfrom
fix/body-location-status-gate
Sep 18, 2026
Merged

abdulsaheel merged 1 commit into
mainfrom
fix/body-location-status-gate

Conversation

@abdulsaheel

@abdulsaheel abdulsaheel commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

same status-gate pattern as getClock/getDataRange/getAlarmTime/selectWrist fixed tonight — a failed outer reply's body bytes are stale, previously unconditionally decoded as a confident (and possibly wrong) body-location reading.

this one was confirmed real by fresh adversarial verification during tonight's bug-hunt cycle but its plan-stage agent kept failing structured-output schema validation and never reached implementation — found and finished manually.

Summary by Sourcery

Gate Gen5 body-location status decoding on successful outer command responses while preserving existing behavior for Gen4.

Bug Fixes:

  • Prevent Gen5 body-location readings from being decoded when the outer command response reports failure, avoiding stale and misleading values.

Tests:

  • Add coverage for failed and successful Gen5 responses and preserve ungated Gen4 decoding behavior.

Summary by CodeRabbit

  • Bug Fixes

    • Body location and status information is now reported only for successful responses on Gen 5 devices.
    • Gen 5 error responses no longer display invalid body location data.
    • Gen 4 responses continue to decode body location information as expected.
  • Tests

    • Added coverage for successful and unsuccessful responses across Gen 4 and Gen 5 devices.

one more sibling of the getClock/getDataRange/getAlarmTime/selectWrist
status-gate pattern — a failed outer reply's body bytes are stale and
would mint a confident (and wrong) body-location reading. this one fell
through the cracks tonight when its plan-stage agent's structured output
kept failing schema validation and never reached implementation.

@sourcery-ai sourcery-ai 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.

Sorry @abdulsaheel, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 6 days and 17 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: b088ea87-2d33-48ec-abe7-2a10b5636514

📥 Commits

Reviewing files that changed from the base of the PR and between 62fdc4e and 067dc8d.

📒 Files selected for processing (2)
  • lib/src/control.dart
  • test/control_plane_offsets_test.dart
 __________________________________________________________________________________
< Controlling complexity is the essence of computer programming. - Brian Kernighan >
 ----------------------------------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).

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.

@sourcery-ai

sourcery-ai Bot commented Sep 18, 2026

Copy link
Copy Markdown

Reviewer's Guide

Updates GET_BODY_LOCATION_AND_STATUS parsing to ignore stale payload bytes on failed Gen5 outer replies while preserving Gen4 behavior, with tests covering failure, success, and cross-generation compatibility.

Flow diagram for status-gated body location parsing

flowchart TD
    A[GET_BODY_LOCATION_AND_STATUS response] --> B{Gen5 and outer status is not 1?}
    B -->|Yes| C[Skip body_location_status]
    B -->|No| D[Decode body_location_status]
    D --> E[Store revision, locationRaw, confidence, status]
Loading

File-Level Changes

Change Details Files
Gate body-location decoding on the outer command status for Gen5 responses.
  • Compute success from the profile and outer status byte.
  • Only construct body-location data when a Gen5 response reports success, preventing stale failure payload bytes from being decoded.
  • Preserve the existing ungated behavior for Gen4 responses.
lib/src/control.dart
Add regression coverage for status-gated body-location parsing across band generations.
  • Verify Gen5 non-success statuses emit no body-location entry.
  • Verify successful Gen5 responses retain the expected decoded offsets and values.
  • Verify Gen4 responses continue decoding regardless of outer status.
test/control_plane_offsets_test.dart

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@abdulsaheel
abdulsaheel merged commit 54f128e into main Sep 18, 2026
3 of 4 checks passed
@abdulsaheel
abdulsaheel deleted the fix/body-location-status-gate branch September 18, 2026 21:25
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