test(capture-kit,maestro,selectors,provider-limrun): cover shared-package CRAP functions through public entries

Merged
TH
2mo ago
+659-0

Summary

Burns down the shared-package CRAP findings from #3414 by covering each function's uncovered branches through its owning module's public entry point. No production changes, no test-only exports. Five test files, +640 lines, all test-only.

FunctionCRAP before → after
capture-kit/png-rgb-difference.ts computePngRgbDifference42 → 6 (0% → 100%)
capture-kit/react-native-overlay.ts collapsedWarningScores30 → 5 (0% → 100%)
maestro/facade-execution.ts suggestionQuery62 → 14 (38% → 100%)
selectors/index.ts values (in readAgreedTextValue)30 → 5 (0% → 100%)
provider-limrun/runtime.ts getAppState30 → 5 (0% → 100%)
provider-limrun/runtime.ts deviceInventoryProvider (same file, scored 0% locally)42 → 6 (0% → 100%)

getAppState and deviceInventoryProvider are covered through the real daemon load path (createLimrunRuntime(..., { includePlatformModule: true }) → loadRuntime → bind); suggestionQuery through executeMaestroFlow + collectMaestroFailureSuggestions with a failing runtime port. Each new test was mutation-checked (e.g. the swipe arm, the hittable score, the all-agree guard each turn one red).

Closes #3423, part of #3414.

Validation

Tested at c02690688 (pushed head; base da46f4c1c).

  • pnpm check:affected --run locally: all runnable checks passed (fallow diff audit clean, related tests passed).
  • Local vitest related --coverage + pnpm check:coverage-crap --all: "no function(s) at or above 30" (was 6 on these files at da46f4c1c).
  • CI on the head: all 18 checks pass; the Coverage job's Report coverage-based CRAP step: "no touched function(s) at or above 30".
  • cubic-dev-ai review: both findings (P2 id-basis coverage, P3 test name) fixed in c02690688, threads replied and resolved.