Repository navigation
strain: price every strain on the user's own quiet-waking level #551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
abdulsaheel
merged 5 commits into
OpenStrap:main
from
DropTabl:fix/strain-personal-quiet-hrr
Oct 9, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
224e9c9
strain: price every strain on the user's own quiet-waking level
DropTabl d78f636
strain: seed quiet levels on the live derive's ceiling
DropTabl 3a94371
strain: the quiet-level seed picks measured days first and moves the …
DropTabl 38e0378
strain: hash the newest quiet level once a later day sits on it
abdulsaheel 0d8daf5
two-device golden: strain's provenance label for the personal quiet l…
abdulsaheel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| // THE personal quiet-waking level for scoring anything OUTSIDE a derive sweep | ||
| // — a saved/edited session, the on-read re-score, the live gauge, the strain | ||
| // rescale. A day's own derive reads the same window from its sweep snapshot | ||
| // (`_BaselineHistoryCache.valuesBefore('quiet_hrr', date)`); this is that read | ||
| // against the database, so a session and the day it sits in are priced on one | ||
| // level. | ||
|
|
||
| import 'package:openstrap_analytics/onehz.dart' as ana; | ||
|
|
||
| import '../data/db.dart'; | ||
|
|
||
| /// The median of the trailing 28 measured `quiet_hrr` days strictly before | ||
| /// [dayLabel] (a LOCAL day label). Absent — never a stand-in — below three | ||
| /// days, or when the read fails. | ||
| Future<ana.Metric<ana.QuietLevel>> personalQuietLevelBefore( | ||
| String dayLabel, | ||
| ) async { | ||
| try { | ||
| return ana.personalQuietWakingHrr( | ||
| await LocalDb.trailingSeriesValues( | ||
| 'quiet_hrr', | ||
| ana.quietHrrWindowDays, | ||
| before: dayLabel, | ||
| ), | ||
| ); | ||
| } catch (_) { | ||
| return ana.personalQuietWakingHrr(const []); // abstains, never a stand-in | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.