Skip to content

feat(metrics): Add sustained and fast energy impact ranking - #116

Merged
bigtomcat6 merged 5 commits into
mainfrom
feat/energy-impact-part5-dual-timescale-ranking
Aug 10, 2026
Merged

feat(metrics): Add sustained and fast energy impact ranking#116
bigtomcat6 merged 5 commits into
mainfrom
feat/energy-impact-part5-dual-timescale-ranking

Conversation

@bigtomcat6

@bigtomcat6 bigtomcat6 commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Summary

This branch improves Energy Impact metric reporting by introducing sustained-energy
ranking and clearer provisional labeling.

  • Add a sustained energy window and separate fast-vs-sustained impact scoring logic so sustained activity is no longer collapsed into only transient spikes.
  • Rank both fast and sustained impact values so ordering in Energy Impact views reflects the stronger of the two profiles.
  • Label provisional impact values explicitly when the underlying score should be treated as non-final or non-committal.
  • Propagate the new behavior across publication state, sampling, statistics, and presentation models, and update unit tests to cover the new ranking and presentation paths.

How to test

  • Review changes in:
    • Sources/MacActivityApp/Models/EnergyImpactPresentation.swift
    • Sources/MacActivityCore/Metrics/Providers/EnergyImpactPublicationState.swift
    • Sources/MacActivityCore/Metrics/Providers/EnergyImpactSampler.swift
    • Sources/MacActivityCore/Metrics/Providers/EnergyImpactStatistics.swift
    • Sources/MacActivityCore/Metrics/Providers/EnergyImpactTypes.swift
  • Run focused tests (environment-specific):
    • swift test --filter EnergyImpact (blocked in this sandbox due Swift toolchain cache permission errors: /Users/how/.cache/clang/ModuleCache)

Release impact

  • Type: Added
  • Release note: Energy Impact now supports sustained impact ranking alongside fast impact ranking, with provisional labels shown for low-confidence values so users can distinguish stable energy behavior from transient spikes.

Checklist

  • I have seen this code, I have run this code, and I take responsibility for this code.
  • PR title follows type(scope): Summary.
  • Tests or a clear manual verification path are included.
  • User-facing changes include release-note wording or Release impact: None.

@bigtomcat6 bigtomcat6 added the feature PR Label label Aug 10, 2026
@bigtomcat6 bigtomcat6 self-assigned this Aug 10, 2026
@bigtomcat6

Copy link
Copy Markdown
Owner Author

@codex review

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.22879% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...tyCore/Metrics/Providers/EnergyImpactSampler.swift 99.01% 2 Missing ⚠️
...ore/Metrics/Providers/EnergyImpactStatistics.swift 99.06% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@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: ccd862433f

ℹ️ 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 Sources/MacActivityCore/Metrics/Providers/EnergyImpactSampler.swift
Comment thread Sources/MacActivityCore/Metrics/Providers/EnergyImpactSampler.swift
Comment thread Sources/MacActivityCore/Metrics/Providers/EnergyImpactStatistics.swift Outdated

@bigtomcat6 bigtomcat6 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

reviewed

@bigtomcat6
bigtomcat6 marked this pull request as ready for review August 10, 2026 11:47
@bigtomcat6
bigtomcat6 merged commit b42bcbe into main Aug 10, 2026
14 of 15 checks passed
@bigtomcat6
bigtomcat6 deleted the feat/energy-impact-part5-dual-timescale-ranking branch August 14, 2026 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature PR Label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant