Remove 13 production exports that were consumed only by their own unit
tests, along with those tests. Found via a fallow production-vs-default
unused-export differential (exports unused by production but kept "live"
by a test), then each candidate was reachability-traced and the verdict
adversarially re-verified to confirm zero production use (internal,
re-export, registry, or dynamic dispatch).
Removed exports + their dedicated tests:
- backend.ts: hasBackendCapability, hasBackendEscapeHatch (+ orphaned
BACKEND_CAPABILITY_ESCAPE_HATCH_METHODS) — cascade from runtime change
- runtime.ts: assertBackendCapabilityAllowed
- command-catalog/capabilities: (kept — see below)
- commands/cli-grammar/common.ts: commandNameSet (no test; pure dead)
- compat/maestro/support-matrix.ts: MAESTRO_COMPAT_UNSUPPORTED_CAPABILITIES
- core/dispatch-resolve.ts: resolveIosDevice
- daemon-client.ts: openApp (standalone fn; Backend.openApp untouched)
- daemon/daemon-command-registry.ts: listDaemonHandlerCommands
- daemon/post-gesture-stabilization.ts: capturePostGestureStabilizedSnapshot
- platforms/android/scroll-hints.ts: annotateAndroidScrollableContentHints
- platforms/ios/runner-session.ts: stopRunnerSession
- platforms/ios/runner-xctestrun-products.ts: xctestrunReferencesExistingProducts
- replay/script.ts: parseReplayScript
- utils/cli-option-schema.ts: getOptionSpecForToken
- utils/finders.ts: findNodeByLocator
Tests whose real subject is live code (handler routing, snapshot status,
writeReplayScript, maestro doc-sync) were rewritten to drop the dead
symbol while keeping coverage, not deleted.
typecheck, lint, and the unit suite (2568 tests) pass; fallow
production unused-exports drops 231 -> 218 with no new dead code.
Summary
Removes 13 production exports that were consumed only by their own unit tests, plus those tests. These are exports kept "alive" purely by a test that exercises them — no production code path (internal, re-export, registry, or dynamic dispatch) reaches them.
28 files changed, −1121/+31.
How they were found
A
fallowproduction-vs-default differential:fallow dead-code --unused-exports --production(tests excluded) flagged 231 exports.fallow dead-code --unused-exports(tests count as consumers) flagged 2.Each of the 229 was then reachability-traced and classified into dead / live-internal-seam / false-positive, and every "dead" verdict was adversarially re-verified by an independent pass that tried to find any production use. That filter matters — it overturned 4 candidates that looked test-only but were actually reachable (e.g.
buildSnapshotVisibility,withAppleToolProvider). This PR ships only the 13 high-confidence, fully-verified removals.Removed exports (+ their dedicated tests)
commandNameSetcommands/cli-grammar/common.ts(no test — pure dead)openApp(standalone fn)daemon-client.ts— distinct from the liveBackend.openAppmethodresolveIosDevicecore/dispatch-resolve.tsstopRunnerSessionplatforms/ios/runner-session.tsxctestrunReferencesExistingProductsplatforms/ios/runner-xctestrun-products.tscapturePostGestureStabilizedSnapshotdaemon/post-gesture-stabilization.tsannotateAndroidScrollableContentHintsplatforms/android/scroll-hints.tsparseReplayScriptreplay/script.tslistDaemonHandlerCommandsdaemon/daemon-command-registry.tsgetOptionSpecForTokenutils/cli-option-schema.tsfindNodeByLocatorutils/finders.ts(not the publicfinders.tsentry)assertBackendCapabilityAllowedruntime.tsMAESTRO_COMPAT_UNSUPPORTED_CAPABILITIEScompat/maestro/support-matrix.tsRemoving
assertBackendCapabilityAllowedcascaded into now-unusedbackend.tshelpers (hasBackendCapability,hasBackendEscapeHatch, and theBACKEND_CAPABILITY_ESCAPE_HATCH_METHODSmap), which are removed too.Preserved coverage
Tests whose real subject is live code but which incidentally used a removed symbol were rewritten to keep their coverage, not deleted:
getDaemonCommandRoute/ catalog).getRunnerSessionSnapshotstatus test (dropped only thestopRunnerSessionteardown).writeReplayScriptwhitespace test (asserts serialized output directly instead of round-tripping throughparseReplayScript).Deliberately NOT included (follow-ups)
Three other test-only exports were found but left in place because removal isn't mechanical:
parseArgs(utils/args.ts) — a test-only wrapper over the production-liveparseRawArgs+finalizeParsedArgs; its tests cover live parse behavior and live inargs.test.tsalongside the CLI-help assertions. Needs re-pointing, not deletion.listCapabilityCommands/listCapabilityCheckedCommandNames— test-only consistency guards asserting the capability matrix and parser schema stay in sync. The functions are test-only but the invariant is real.There are also ~170 live-internal-seam exports (logic runs in production;
exportexists only for a unit test) that could be un-exported as a separate lower-risk sweep.Validation
pnpm typecheck✓pnpm lint✓pnpm test:unit✓ (2568 tests; the 3fillAndroidflakes are the known process-spawn contention flake in an untouched file — pass in isolation in 4.7s)fallowproduction unused-exports: 231 → 218, no new dead-everywhere exports introduced.🤖 Generated with Claude Code