Skip to content

Cap + rotate the Oura activity MET research corpus (#676 follow-up) - #680

Merged
ryanbr merged 2 commits into
mainfrom
fix/oura-activity-dump-rotation-676
Jul 20, 2026
Merged

Cap + rotate the Oura activity MET research corpus (#676 follow-up)#680
ryanbr merged 2 commits into
mainfrom
fix/oura-activity-dump-rotation-676

Conversation

@ryanbr

@ryanbr ryanbr commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Follow-up to #676. That sidecar is always-on for every paired Oura and appends forever with no cap (~100 KB/day → unbounded). Every other diagnostic log is bounded (the WHOOP5 deep-buffer log rotates at 60 MB); this one wasn't.

Adds a 25 MB cap + single-.1 rotation on both platforms (bounded ~50 MB on disk), mirroring the deep-buffer log's rotation. Best-effort — a rotation error falls through to the append. No encoder/schema/dedup change; the corpus stays always-on (gating would starve the research data, so bounding is the right lever).

Verified: Android compileFullDebugKotlin + OuraActivityDumpLineTest ✓. iOS mirrors the Kotlin change (rotation in record() + maxBytes); compiles on the app-build attached here.

ryanbr added 2 commits July 21, 2026 04:40
The #676 sidecar is always-on for every paired Oura and appended forever
with no bound — ~100 KB/day, growing without limit. Every other diagnostic
log in the tree is capped (the WHOOP5 deep-buffer log rotates at 60 MB); this
one wasn't. Add a 25 MB cap with single-'.1' rotation on both platforms
(bounded to ~50 MB on disk), mirroring the deep-buffer pattern. Best-effort:
a rotation error just falls through to the append. No encoder/schema change.

Verified: compileFullDebugKotlin + OuraActivityDumpLineTest. iOS mirrors the
Kotlin change; compiles on the app-build run.

Author: ryanbr <mp3geek@gmail.com>
Re-review catch: resolveURL() reuses one cached URL object across every
record() call, and URL.resourceValues caches the fileSize on it — so the
rotation size check could read a stale small value and never fire on iOS.
FileManager.attributesOfItem is a fresh stat each call. Android's
File.length() was already fresh; no Kotlin change needed.

Author: ryanbr <mp3geek@gmail.com>
@ryanbr
ryanbr merged commit 52349dc into main Jul 20, 2026
7 checks passed
@ryanbr
ryanbr deleted the fix/oura-activity-dump-rotation-676 branch July 20, 2026 16:58
ryanbr added a commit that referenced this pull request Jul 20, 2026
Marketing version stays 9.0.3; Android versionCode 296->297 and iOS
CURRENT_PROJECT_VERSION 206->207 so the new staging build installs over the
previous one. Content since the last testing build: Health Connect writeback
failure surfacing (#672), SpO2/respiration empty-track explanation (#673),
WHOOP 5/MG raw-IMU offload persist (#675), hide stale sleep recompute entries
(#679), Oura activity MET research corpus + cap/rotation (#676/#680), trend
chart date alignment (#528), and corrupt-DB quarantine preservation (#681).
DX23876 pushed a commit to DX23876/noop that referenced this pull request Jul 22, 2026
…-up) (ryanbr#680)

Bounds the always-on ryanbr#676 Oura sidecar with a 25 MB cap + single-.1 rotation on both platforms (~50 MB on disk max), mirroring the WHOOP5 deep-buffer log. Best-effort; no encoder/schema change. iOS size read via FileManager (fresh stat) to avoid URL resource-value caching. Verified: Android compileFullDebugKotlin + OuraActivityDumpLineTest; iOS+macOS app-build green.
DX23876 pushed a commit to DX23876/noop that referenced this pull request Jul 22, 2026
Marketing version stays 9.0.3; Android versionCode 296->297 and iOS
CURRENT_PROJECT_VERSION 206->207 so the new staging build installs over the
previous one. Content since the last testing build: Health Connect writeback
failure surfacing (ryanbr#672), SpO2/respiration empty-track explanation (ryanbr#673),
WHOOP 5/MG raw-IMU offload persist (ryanbr#675), hide stale sleep recompute entries
(ryanbr#679), Oura activity MET research corpus + cap/rotation (ryanbr#676/ryanbr#680), trend
chart date alignment (ryanbr#528), and corrupt-DB quarantine preservation (ryanbr#681).
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