summaryrefslogtreecommitdiff
path: root/CLAUDE.md
diff options
context:
space:
mode:
Diffstat (limited to 'CLAUDE.md')
-rw-r--r--CLAUDE.md33
1 files changed, 23 insertions, 10 deletions
diff --git a/CLAUDE.md b/CLAUDE.md
index 623ba1b..3abde17 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -87,9 +87,11 @@ claims three separate times across these repos.
2. **Tests** — `./gradlew testDebugUnitTest` passes in full.
3. **Static analysis** — `./gradlew detekt lintDebug` clean: zero lint errors, zero new detekt
findings beyond the baseline.
-4. **Coverage must not decrease** against `.coverage-baseline` (line coverage over
- `app/src/main/java` excluding `ui/**`). Set `COVERAGE_EXCEPTION="reason"` for justified drops,
- e.g. deleting covered dead code.
+4. **Coverage must not decrease** against `.coverage-baseline` — line coverage over
+ `app/src/main/java`, less Compose screens and the framework adapters listed in
+ `app/build.gradle.kts`. Set `COVERAGE_EXCEPTION="reason"` for justified drops, e.g. deleting
+ covered dead code. With the adapters excluded the number is about 90%, so a drop now means
+ something; before it hovered around 65% and mostly measured how much glue existed.
5. **Manifest permission diff** — if `<uses-permission>` changed, the commit message says why.
6. **Schema migrations** — if `AppDatabase.kt`'s `version` changed, a migration test must be
touched in the same diff. Room tracks by version; a wrong migration corrupts a real,
@@ -188,13 +190,24 @@ out of a possibly-partial MP3, and the JSON path covers the shows that mark chap
## Things a future session should know
-- **The coverage gate has been overridden four times**, each recorded in the commit message. All
- four are Android-framework glue that cannot execute off-device: the Chaquopy bridge,
- PlaybackService, ChaquopyYouTubeSource, PlayerConnection and the two Workers. Each time the
- gate fired it was a useful prompt — it drove PositionWriter onto a narrow Playhead interface
- and pulled RetentionSweeper out of its Worker, both of which found or prevented real bugs.
- If the exceptions keep accumulating, the honest fix is a jacoco exclusion for framework
- adapters, which is a decision for Peter rather than something to slip in.
+- **Framework adapters are excluded from coverage, as of 2026-09-26.** The gate had been
+ overridden eight times, every one a class whose whole body is a call into ExoPlayer, Media3,
+ Room, WorkManager or Chaquopy. The last few overrides were perverse: pulling decisions *out*
+ of a service into tested classes lowered the number, and writing an instrumented test for a
+ migration lowered it again, because `jacocoTestReport` measures unit tests only. A metric that
+ punishes both was measuring how much Android glue exists.
+
+ Peter's call, taken 2026-09-26. The list lives in `app/build.gradle.kts` next to its reasoning,
+ and coverage went 65.04% → 89.93% on the same code. **Adding to that list needs a reason, not
+ just a name** — the bar is "cannot execute off a device", not "awkward to test". Earlier, the
+ gate firing was a useful prompt: it drove PositionWriter onto a narrow Playhead interface and
+ pulled RetentionSweeper out of its Worker, both of which found real bugs. That value only
+ survives if the list stays honest.
+
+ `jacocoFullReport` adds instrumented coverage on top, for when you want the fuller picture
+ with a device attached. The commit gate deliberately does not read it: device data only exists
+ after a device run, so folding it in would make the gate report different numbers for
+ identical code.
- **Detekt config has been relaxed five times**, all documented inline in `config/detekt/detekt.yml`.
Twice the better answer was restructuring instead: `Screens.kt` was split per screen and