CycleData.repository defaults to the retired baseline engine #49

Closed
opened 2026-08-20 16:13:29 -05:00 by null · 0 comments
Owner

What is true now. CycleData.repository(context, engine = BaselinePredictionEngine(), clock = ...) carries a default for engine. No production or test caller relies on it — DataModule.kt:48 and all five test call sites pass an engine explicitly — so nothing is broken today.

What it costs. Nothing yet, and silently everything later: a future caller who omits the argument compiles cleanly and ships BaselinePredictionEngine, the prototype PRODUCT_PLAN §11 names as an unacceptable final engine, retired in Batch 02. Which engine ships is one decision made in one line (DataModule.predictionEngine()); a default here is a second, silent place to take it.

What to do. Make the parameter required and drop the now-unused import. Keep clock's default — the system clock is not a product choice, and §50's timezone tests need to override it.

Traps. BaselinePredictionEngine itself stays in the tree: it is the frozen control EngineComparisonTest measures the real engine against, and its own DEFAULT_CYCLE_DAYS = 28.0 must not be changed when the personal engine's population default moves.

Verify: grep -rn "CycleData.repository(" --include="*.kt" shows every call site passing an engine, and ./gradlew :core:data:compileDebugKotlin :app:compileDebugKotlin succeeds — the compiler is the test.

**What is true now.** `CycleData.repository(context, engine = BaselinePredictionEngine(), clock = ...)` carries a default for `engine`. No production or test caller relies on it — `DataModule.kt:48` and all five test call sites pass an engine explicitly — so nothing is broken today. **What it costs.** Nothing yet, and silently everything later: a future caller who omits the argument compiles cleanly and ships `BaselinePredictionEngine`, the prototype PRODUCT_PLAN §11 names as an unacceptable final engine, retired in Batch 02. Which engine ships is one decision made in one line (`DataModule.predictionEngine()`); a default here is a second, silent place to take it. **What to do.** Make the parameter required and drop the now-unused import. Keep `clock`'s default — the system clock is not a product choice, and §50's timezone tests need to override it. **Traps.** `BaselinePredictionEngine` itself stays in the tree: it is the frozen control `EngineComparisonTest` measures the real engine against, and its own `DEFAULT_CYCLE_DAYS = 28.0` must not be changed when the personal engine's population default moves. Verify: `grep -rn "CycleData.repository(" --include="*.kt"` shows every call site passing an engine, and `./gradlew :core:data:compileDebugKotlin :app:compileDebugKotlin` succeeds — the compiler is the test.
null added this to the Batch 09 — Prediction Science & Hardening milestone 2026-08-20 16:13:29 -05:00
null added the
P2
label 2026-08-20 16:13:29 -05:00
null closed this issue 2026-08-20 16:13:57 -05:00
Sign in to join this conversation.
No Label
P0
P1
P2
release-blocker
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: null/Privacy-Period-Tracker#49
No description provided.