Skip to content

chore: delete dead tap-by-text runner arm and settledAfterMs; hint on tiny stable trees#1089

Merged
thymikee merged 1 commit into
mainfrom
chore/tier1-deletions
Jul 4, 2026
Merged

chore: delete dead tap-by-text runner arm and settledAfterMs; hint on tiny stable trees#1089
thymikee merged 1 commit into
mainfrom
chore/tier1-deletions

Conversation

@thymikee

@thymikee thymikee commented Jul 4, 2026

Copy link
Copy Markdown
Member

Dead-code/polish pass (tier-1 items from the dead-code audit). Refs #1078.

Changes

1. Delete the runner tap-by-text arm

The .tap case's if let text = command.text { ... } branch in RunnerTests+CommandExecution.swift is dead: the daemon only ever sends selectorKey/selectorValue or x/y taps (src/platforms/apple/interactions.ts), and daemon + runner ship in lockstep. The findElement(app:text:) helper stays — the findText probe still uses it. The tap fallthrough error message now says "tap requires a selector or x/y".

The text? field on RunnerCommand (runner-contract.ts) is a shared flat field legitimately used by type/findText/readText, so the contract type is unchanged.

2. Delete settledAfterMs from the wait stable result

It always equaled waitedMs and has never shipped: the latest tag (v0.18.3) predates the wait-stable merge (#1059, ab55db0 is in v0.18.3..HEAD; no tag contains it). Removed from WaitCommandResult, the waitForStable return, toDaemonWaitData, and the test assertion. No client-types/docs references existed.

3. Tiny-tree hint for wait stable (#1078)

When wait stable settles on a tree with fewer than 5 nodes, the result now carries:

Settled on a nearly-empty tree — the app may still be loading. Wait for specific content (wait text ...) before interacting.

toDaemonWaitData passes the hint through. Tests: 3-node settle asserts the hint; 6-node settle asserts no hint key.

4. interaction-common.ts sweep

Audit-only outcome: after #1083, everything still exported from src/daemon/handlers/interaction-common.ts (finalizeTouchInteraction, ContextFromFlags, InteractionHandlerParams) has 3-4 consumers each. Nothing single-consumer or dead; fallow audit --base origin/main and --gate all report no issues. No code change.

5. GENERIC_EXIT_MESSAGE audit (no code change)

The GENERIC_EXIT_MESSAGE replacement branch in src/kernel/errors.ts is still load-bearing post-#1074: createExitError (src/utils/exec.ts:334 sync path, :684 async spawn close path) remains the default failure shape for every non-allowFailure exec and produces exactly "<tool> exited with code N" with processExitError: true via execFailureDetails. The branch is NOT deletable.

Verification

  • pnpm format:check && pnpm typecheck && pnpm lint
  • pnpm exec fallow audit --base origin/main — no issues
  • pnpm exec vitest run src/commands src/daemon src/contracts — 142 files, 1229 tests
  • pnpm exec vitest run test/integration — 27 files, 89 tests
  • Runner Swift files pass swiftc -parse
  • Note: request-handler-catalog.test.ts and the doctor integration scenario timed out once each under heavy host load (load avg >60); both reproduce on origin/main and pass on retry — the known flaky-under-contention pattern, not a regression.

… tiny stable trees

- Remove the runner .tap text arm: the daemon only ever sends
  selectorKey/selectorValue or x/y taps (src/platforms/apple/interactions.ts),
  and daemon+runner ship in lockstep. findElement(app:text:) stays for the
  findText probe.
- Drop settledAfterMs from the wait stable result: it always equaled waitedMs
  and never shipped in a release (v0.18.3 predates #1059).
- Add a loading hint when wait stable settles on a tree with fewer than 5
  nodes (#1078): stability on a nearly-empty tree is a weak readiness signal.

Refs #1078
@thymikee

thymikee commented Jul 4, 2026

Copy link
Copy Markdown
Member Author

Reviewed by diff (suites already gated by the author; host is busy running the react-navigation replay suite, CI will re-confirm). All five items check out:

  • The tap-by-text deletion is exactly the audited arm, with the shared text contract field correctly left alone (type/findText/readText use it) and the fallthrough error updated.
  • settledAfterMs: the tag check (v0.18.3 predates feat: add wait stable settle primitive #1059, git tag --contains empty) is the evidence that makes this deletion free — good that it's recorded in the PR.
  • The tiny-tree hint reads well and the threshold constant carries its rationale; the exact-hint + absent-key test pair is the right shape.
  • interaction-common "no action needed" with consumer counts is a valid audit outcome — better than forcing a change.
  • The GENERIC_EXIT_MESSAGE verdict (NOT deletable, two live producers at exec.ts:334/:684) closes that audit question honestly.

LGTM pending CI.

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 1.5 MB 1.5 MB +97 B
JS gzip 486.7 kB 486.7 kB +52 B
npm tarball 591.2 kB 591.2 kB 0 B
npm unpacked 2.1 MB 2.1 MB -434 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 27.9 ms 27.3 ms -0.6 ms
CLI --help 51.9 ms 49.4 ms -2.6 ms

Top changed chunks:

Chunk Raw diff Gzip diff
dist/src/2426.js +127 B +62 B
dist/src/selector-runtime.js -30 B -10 B

@thymikee

thymikee commented Jul 4, 2026

Copy link
Copy Markdown
Member Author

Readiness update: prior review found no actionable blockers, and GitHub checks are now green (21/21). Added ready-for-human.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Jul 4, 2026
@thymikee thymikee merged commit e031a5c into main Jul 4, 2026
21 checks passed
@thymikee thymikee deleted the chore/tier1-deletions branch July 4, 2026 13:59
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-07-04 13:59 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.

1 participant