Skip to content

repin analytics for temp_circadian zero-variance fix, kAlgoVersion 96->97 - #451

Merged
abdulsaheel merged 1 commit into
mainfrom
fix/repin-analytics-temp-circadian
Sep 24, 2026
Merged

abdulsaheel merged 1 commit into
mainfrom
fix/repin-analytics-temp-circadian

Conversation

@abdulsaheel

@abdulsaheel abdulsaheel commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

User description

analytics main moved one commit past the last pin (0441ef9): temp_circadian was reporting IS/IV as 0.0 on a flat skin-temp window instead of withholding, same zero-variance gap circadian_np already guards against. repinned + kAlgoVersion 96->97 since it changes stored numbers.

Summary by Sourcery

Repin analytics and advance the algorithm version to correct zero-variance circadian temperature metrics.

Bug Fixes:

  • Prevent fabricated zero-valued circadian stability and variability metrics for flat or quantized skin-temperature windows by withholding results when variance is zero.

Enhancements:

  • Repin the analytics dependency to include the circadian zero-variance fix.

Chores:

  • Bump the algorithm version from 96 to 97 and update the associated dependency lockfiles and pin metadata.

PR Type

Bug fix


Description

  • Bumps kAlgoVersion 96→97 for temp_circadian zero-variance fix

  • Repins analytics to 0441ef9 (one commit past PR update screenshots, they were 3 weeks stale #75 merge SHA)

  • Fix: flat/quantized skin-temp windows no longer emit fabricated 0.0 for interdailyStability/intradailyVariability

  • Stored circadian_lifestyle output changes for affected users on recompute


Diagram Walkthrough

flowchart LR
  A["analytics pin\n01e8b6e (old)"] -- "one commit past PR #75" --> B["analytics pin\n0441ef9 (new)"]
  B -- "fixes zero-variance guard\nin temp_circadian.dart" --> C["interdailyStability /\nintradailyVariability\nwithheld instead of 0.0"]
  C -- "stored output changes" --> D["kAlgoVersion\n96 → 97"]
  D -- "triggers recompute" --> E["circadian_lifestyle\nday_result rows"]
Loading

File Walkthrough

Relevant files
Bug fix
derivation_engine.dart
Bump kAlgoVersion to 97 and repin analytics SHA                   

lib/compute/derivation_engine.dart

  • Bumps kAlgoVersion from 96 to 97 with a changelog entry describing the
    temp_circadian zero-variance fix
  • Updates kAnalyticsPin from 01e8b6e... to 0441ef9... to match the new
    analytics tip
  • Adds inline comment explaining the fabricated-metric bug and the repin
    rationale
+16/-2   
Dependencies
pubspec.yaml
Repin analytics dependency to zero-variance fix commit     

pubspec.yaml

  • Updates the analytics git ref: from 01e8b6e... to 0441ef9...
  • Adds a detailed comment block documenting the zero-variance fix,
    affected users, and verification command
+12/-1   

Summary by CodeRabbit

  • Bug Fixes
    • Circadian stability and variability metrics are no longer reported as zero when skin-temperature readings are flat or heavily quantized; these values are withheld when they cannot be reliably measured.

…->97

analytics main moved one commit past the #75 pin (0441ef9): temp_circadian's
_nonparam divided by varTot/diffN with no zero-variance guard, so a flat or
heavily-quantized skin-temp window reported interdailyStability/
intradailyVariability as 0.0 instead of withholding — fabricated output on a
flat series. Bumps kAlgoVersion since it changes stored circadian_lifestyle
numbers for real users.

@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 23 hours and 1 minute by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Sep 24, 2026

Copy link
Copy Markdown

Reviewer's Guide

Repins analytics and its lockfile resolution to commit 0441ef9, incorporating the temp-circadian zero-variance guard, and bumps kAlgoVersion from 96 to 97 so affected stored circadian outputs are versioned and recomputed appropriately.

Flow diagram for temp-circadian zero-variance handling

flowchart LR
    A[Skin-temperature window] --> B{varTot or diffN is zero}
    B -->|Yes| C[Withhold metrics]
    B -->|No| D[Compute interdailyStability and intradailyVariability]
    C --> E[Versioned circadian_lifestyle output]
    D --> E
Loading

File-Level Changes

Change Details Files
Repin the analytics dependency to include the temp-circadian zero-variance fix.
  • Update the analytics Git SHA from 01e8b6e to 0441ef9.
  • Document the upstream fix preventing fabricated zero-valued circadian metrics for flat or quantized skin-temperature windows.
  • Refresh the resolved dependency lockfile entry.
pubspec.yaml
pubspec.lock
Bump the algorithm version and record the dependency lineage.
  • Change kAlgoVersion from 96 to 97.
  • Set kAnalyticsPin to the new analytics commit and document the reason for the repin.
  • Add changelog context describing the withheld-metric behavior on zero variance.
lib/compute/derivation_engine.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

@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: OpenStrap/edge/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 2eb4054d-1cec-47e7-ac14-44064aa935e5

📥 Commits

Reviewing files that changed from the base of the PR and between 74ee411 and 76b97d3.

⛔ Files ignored due to path filters (1)
  • pubspec.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • lib/compute/derivation_engine.dart
  • pubspec.yaml

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The analytics dependency pin changed to a revision described as adding zero-variance guards for circadian stability metrics. The derivation algorithm version increased from 96 to 97.

Changes

Circadian analytics update

Layer / File(s) Summary
Update analytics pin and algorithm version
lib/compute/derivation_engine.dart, pubspec.yaml
The derivation algorithm version changed from 96 to 97. The openstrap_analytics dependency pin changed to 0441ef9e6fc6d5681c309ce6341911285e829f20. The updated comments describe zero-variance guards that withhold interdailyStability and intradailyVariability for flat or quantized skin-temperature windows.

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

Suggested reviewers: localhoop

Merge Risk: ⚪ Minimal · up to 76b97

The updated analytics pin selects the zero-variance fix, and the algorithm version advances for the changed circadian outputs. No concrete merge risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the analytics repin, the temp_circadian zero-variance fix, and the kAlgoVersion change from 96 to 97.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Pin/Version Mismatch Risk

The new kAnalyticsPin is a full 40-char SHA (0441ef9e6fc6d5681c309ce6341911285e829f20) and pubspec.yaml's ref: is set to the same value, which is correct. However, pubspec.lock is not shown in this diff. Per AGENTS.md §4.9, the lock file currently records source: path for siblings and provides no pin guarantee — the source of truth is pubspec.yaml. If pubspec.lock was not regenerated and committed alongside this change (i.e., it still resolves to the old path or old SHA), CI flutter pub get will silently use the wrong commit and the kAlgoVersion bump will not actually carry the fix. The diff does not include pubspec.lock, so this cannot be confirmed from the PR alone.

const String kAnalyticsPin = '0441ef9e6fc6d5681c309ce6341911285e829f20';
Missing Test Pin

The changelog comment references test/db_serve_version_and_reads_test.dart as the file that asserts kAnalyticsPin against pubspec.yaml. A behavior change of this kind (stored circadian_lifestyle output changes for affected users) with a version bump warrants a test that pins the new expected behavior — specifically that a flat skin-temp window produces Metric.absent / null rather than 0.0 for interdailyStability/intradailyVariability. No such test is added or updated in this PR. Per AGENTS.md §5, a behavior change with no accompanying test is a real finding.

const int kAlgoVersion = 97;

@github-actions

Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

No code suggestions found for the PR.

@abdulsaheel
abdulsaheel merged commit 9b4a102 into main Sep 24, 2026
4 checks passed
@abdulsaheel
abdulsaheel deleted the fix/repin-analytics-temp-circadian branch September 24, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant