chore: remove dead type re-exports, prune stale suppressions, gate unused-types#1364
Conversation
Size Report
Startup median (7 runs, lower is better):
Top changed chunks: no changes in the largest emitted chunks. |
Clears the 72 `unused-types` findings left by #1363 and flips `rules.unused-types` from `warn` to `error` so new ones cannot creep in. Every fallow detector is now at zero. 71 of the findings were re-export lines (`export type { X } from './y.ts'` with no importer of X through that path); one was a direct declaration (`HelpTopicName`, zero references anywhere). Removing them cascaded, which is the point: imports that existed only to feed a re-export became unused (8 of them, caught by `noUnusedLocals`), and clearing those exposed a further chain through `command-projection.ts` -> `batch/index.ts` -> `batch/projection.ts`. Also updated a comment in `batch-policy.ts` that described the `command-surface.ts` re-export path this removes, and dropped two `export type {}` husks left where every name in a block was dead. One finding was NOT what it looked like: fallow flagged `DebugSymbolsOptions` and `DebugSymbolsResult` in `apple/core/debug-symbols/types.ts`, but removing them broke `apple/core/debug-symbols.ts`, which re-exported them from there. Both ends were dead — every real consumer imports from `contracts/debug-symbols.ts` — so the fix was removing the intermediate re-export too, not restoring the leaf. Safety: the published type surface is unchanged. All 11 entry points in package.json#exports export exactly the same names before and after. Two chunk files differ only because `AndroidSnapshotBackendMetadata` relocated between internal code-splitting chunks, which is not a consumer-visible boundary.
3e3435a to
493c429
Compare
The whole point of this arc was that fallow looked clean mainly because of its own ignore list, so the list itself deserved an audit. Emptying `ignoreExports` and re-running shows most entries no longer match a real finding: 20 blocks collapse to 5, with no change in what either fallow invocation reports. Removed 8 fully-stale blocks. They went stale for three different reasons: - code moved (`assertSafeDerivedCleanup` is exported from runner-cache.ts, not the runner-xctestrun.ts the suppression named), - the exports became genuinely used (apps.ts, runner-contract.ts, runner-session.ts, cloud-webdriver.ts, the test-utils fixtures), - and `installAndroidInstallablePath` was suppressed in two places at once. `app-lifecycle.ts` needed a code fix rather than a suppression: it re-exported three `parseAndroid*` helpers from app-parsers.ts that nothing imports through it, so the re-export is dropped and the block goes away. The two type re-exports on that statement ARE consumed and stay. The seven `src/daemon/handlers/*` blocks are KEPT, collapsed into one documented glob. They are not stale: those handlers are reached only through the dynamic `import()` table in request-handler-chain.ts, which the --production analysis behind `check:production-exports` cannot follow. A first pass removed them because the staleness probe only exercised the default config; the repo runs fallow twice, and `check:production-exports` caught it.
|
Reviewed |
|
- drop the consumer-less AndroidFillVerificationNode re-export - reuse requireSnapshotSession in resolveSnapshotForRef instead of inlining the same authorized-frame resolution (fallow clone group); the helper's return type now guarantees the session it already throws for
…#1367) * chore: remove verified dead code and migration scaffolding Multi-agent audit of accumulated waste, every finding adversarially verified against call sites, git history, and the published surface before removal. Net -710 lines. - delete src/core/platform-descriptor/ (superseded ADR-0009 migration scaffold; parity tests now assert an inline table) - remove test-only seams: registry introspection exports, CommandFacet.extraDaemonWriters, MaestroEngineOptions.timing - remove dead flexibility: backend capability allow-list, screenshot-diff maxRegions, CloudWebDriverSupportLevel 'partial', clearFirst on the TS+Swift runner wire contract - remove dead deprecated surface: --session-locked / --session-lock-conflicts aliases (hard migration error now points at --session-lock), replay export --format single-value enum, unused Lease*Payload contract types, runtime-layer rotate duplicate - collapse pass-throughs/duplication: withRetry adapter, default-cloud-artifact-provider, connect-profile client-id hashing (3x sha256 impls -> one helper, byte-identical output), shared scripts walker, cloneValue -> structuredClone, fill-diagnostics moved into android/ BREAKING CHANGE: --session-locked and --session-lock-conflicts now fail with a migration error pointing at --session-lock; replay export --format is removed (Maestro was the only value); Lease*Payload types are dropped from the ./contracts subpath. * chore: satisfy fallow gates tightened by #1363/#1364 after rebase - drop the consumer-less AndroidFillVerificationNode re-export - reuse requireSnapshotSession in resolveSnapshotForRef instead of inlining the same authorized-frame resolution (fallow clone group); the helper's return type now guarantees the session it already throws for * chore: address review — keep cloud-webdriver partial capability metadata The partial/supported/unsupported levels and their notes are part of the lease-response capability contract for genuinely limited operations (Appium page-source snapshots, upload-then-install), not dead scaffolding. Restore them and the asserting tests unchanged from main. Also add the missing CHANGELOG entry for the Lease*Payload type removal from agent-device/contracts.
What
Two related cleanups that finish the arc started in #1363, and turn the
unused-typesrule fromwarnintoerror. Every fallow detector is now at zero, with a suppression list that's 4x smaller.1. Dead type re-exports (72 findings)
71 were re-export lines (
export type { X } from './y.ts'with no importer of X through that path); one was a direct declaration (HelpTopicName, zero references anywhere).Removing them chained, which is the argument for gating it:
noUnusedLocals.command-projection.ts→batch/index.ts→batch/projection.ts.export type {}husks were left where every name in a block was dead — caught by oxlint'sno-useless-empty-export, not by fallow.batch-policy.tsdocumented thecommand-surface.tsre-export path this removes; updated so it doesn't rot.One finding wasn't what it looked like. fallow flagged
DebugSymbolsOptions/DebugSymbolsResultinapple/core/debug-symbols/types.ts; removing them brokeapple/core/debug-symbols.ts, which re-exported them from there. The instinct is to restore the leaf — but both ends were dead. Every real consumer imports fromcontracts/debug-symbols.ts, so the fix was removing both together.2. Stale suppressions (20 blocks → 5)
The premise of #1363 was that fallow looked clean largely because of its own ignore list — so the list deserved the same audit. Emptying
ignoreExportsand re-running shows most entries no longer match any finding. They went stale for three different reasons:assertSafeDerivedCleanupis exported fromrunner-cache.ts, not therunner-xctestrun.tsthe suppression named.apps.ts,runner-contract.ts,runner-session.ts,cloud-webdriver.ts, the test-utils fixtures.installAndroidInstallablePathwas suppressed in two places at once.app-lifecycle.tsneeded a code fix rather than a suppression: it re-exported threeparseAndroid*helpers fromapp-parsers.tsthat nothing imports through it. The re-export is dropped and the block goes away; the two type re-exports on that statement are consumed and stay.Important
The seven
src/daemon/handlers/*blocks are kept (collapsed into one documented glob). They are not stale — those handlers are reached only through the dynamicimport()table inrequest-handler-chain.ts, which the--productionanalysis behindcheck:production-exportscannot follow to a consumer. My first pass removed them because the staleness probe only exercised the default config; the repo runs fallow twice, andcheck:production-exportscaught the mistake.Safety: the published API is unchanged
Built
mainand this branch, then compared the exported names of all 11 entry points inpackage.json#exports:Note
A raw byte-compare of
dist/src/*.d.tsshows 2 of 19 files differing. That is not an API change:AndroidSnapshotBackendMetadatarelocated between internal code-splitting chunks (sdk-android-adb.d.ts→index.d.ts). Chunk files aren't published entry points, so that boundary isn't consumer-visible — which is why the entry-point comparison above is the authoritative check, not byte identity.Verification
Rebased onto
mainafter #1363, #1362 and #1360 landed, and re-verified against the new tip:pnpm typecheck,pnpm lint,pnpm check:tooling,pnpm check:fallow,pnpm check:production-exports,pnpm format:check— all cleanfallow dead-code— all detectors zero, in both the default and--productionconfigs