Skip to content

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

Merged
thymikee merged 2 commits into
mainfrom
crap/3423-shared-packages
Oct 11, 2026
Merged

thymikee merged 2 commits into
mainfrom
crap/3423-shared-packages

Conversation

@thymikee

@thymikee thymikee commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

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.

Function CRAP before → after
capture-kit/png-rgb-difference.ts computePngRgbDifference 42 → 6 (0% → 100%)
capture-kit/react-native-overlay.ts collapsedWarningScores 30 → 5 (0% → 100%)
maestro/facade-execution.ts suggestionQuery 62 → 14 (38% → 100%)
selectors/index.ts values (in readAgreedTextValue) 30 → 5 (0% → 100%)
provider-limrun/runtime.ts getAppState 30 → 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.

…-package CRAP functions through their public entries

- png-rgb-difference: compare, dimension, and data-length outcomes through the
  worker client's synchronous parity path (png-rgb-difference.test.ts)
- react-native-overlay: collapsed-warning dismissal scoring via analyzeReactNativeOverlay
- facade-execution: every suggestionQuery branch through executeMaestroFlow and
  collectMaestroFailureSuggestions with a failing runtime port
- selectors: alternative-collapse branches of projectSelectorExpression
- provider-limrun runtime: app-state reader and device inventory through the
  platform module's loadRuntime/bind path

Closes #3423
@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.17 MB 5.17 MB 0 B
Package (unpacked) 5.17 MB 5.17 MB 0 B
Package (download) 1.55 MB 1.55 MB -2 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 28.1 ms 27.4 ms -0.6 ms
CLI --help 79.2 ms 77.2 ms -2.1 ms

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 5 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread packages/capture-kit/src/react-native-overlay.test.ts Outdated
…sis and name the banner fallback by its absent fact

Follow-up on the cubic-dev-ai review of #3440:

- the text-selector case had removed the identifier, so it only pinned the
  label basis; a second case now carries the selector text as the node's
  visible text and pins the id basis (mutation-checked: inverting that arm
  of suggestionBasis turns it red)
- the tied-banner test said "no ref" while its nodes carry refs; the fact
  actually absent is hittable, which is now what the name states
@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready at c026906. The diff is test-only, so it cannot affect any production route, and all 18 checks pass. I did not run the tests, the coverage or the CRAP script myself, so the mutation and CRAP claims rest on the PR body and the green Coverage job. No conflicts. Nothing stands between this PR and merge.

Not blocking: testDependencies() in runtime.test.ts is almost a copy of TEST_DEPENDENCIES in device-session.test.ts, and requestScope() re-declares limrunRuntimeScope from runtime.fixtures.ts. One shared dependencies factory in runtime.fixtures.ts, which #3423 allows, would cover both. You can take this or leave it.

Both earlier inline threads are fixed at this head, so please resolve them: the overlay test rename (#3440 (comment)) and the id basis coverage, which the maestro test in facade-failure-suggestions.test.ts now covers (#3440).

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Oct 11, 2026
@thymikee
thymikee merged commit a0f9b0b into main Oct 11, 2026
18 checks passed
@thymikee
thymikee deleted the crap/3423-shared-packages branch October 11, 2026 19:01
@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-11 19:01 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CRAP: shared packages (capture-kit diffing and overlay, maestro, selectors, limrun)

1 participant