Skip to content

[quality] tide's verdict arms (unknown-retry exhaustion, moved head, 405/409 refusals, merged/closed/locked, check_suite guards) never run through dist/index.js #346

Description

@hivecommons-hive

Finding

src/plugins/tide.ts is the merge path every event, the comment sweep and both cron jobs funnel through, and its verdict arms — what evaluateMerge does when GitHub does not simply answer clean and merge — are exercised only by the unit suite. The shipped bundle never reaches them.

Unit evidence — npx vitest run --coverage on main @ 3fc21f2 (Node v26.10.0, vitest 5.0.3, @vitest/coverage-v8): src/plugins/tide.ts 100 % statements / 100 % branches / 100 % functions / 100 % lines.

End-to-end evidence — npm run test:coverage:e2e (the source-mapped __tests__/bundle run from #274) on the same revision: src/plugins/tide.ts 158/195 lines (81.02 %), 74.3 % branches. To separate open ground from ground the held bundle PRs already claim, the diffs of all 33 open __tests__/bundle/* PRs (#242–#345) were applied onto main and the run repeated: tide.ts rises to 89.23 % lines, and these lines stay uncovered by every one of them:

lines arm
99, 108–111 fetchMergeability: mergeability still unknown after the 1 s / 2 s / 4 s retries → not mergeable (unknown)
175 evaluateMerge once: the second cron job (sweep + lgtm in one run) skips a pull request as already evaluated in this run
208 head moved while mergeability was computed
219 merge refused with 405 because a concurrent event merged first → merged concurrently
223 merge refused with 409 → base branch moved / head moved
399, 402, 405 blockedReason: already merged, closed, locked
439 isMerged re-read after a refused merge fails → the refusal is reported as is
496–497 tideOnComment on a closed pull request
520 tideOnCheckSuite with no head_sha / sha in the payload
564–565 tideOnCheckSuite naming no pull request, listing finding none

(96 is the never-used retryIf default; 236–237 is the test-only resetTideWarnings; 489 is unreachable through the dispatcher — every command throws on a missing issue first, see #343.)

Provenance: local runs, main @ 3fc21f2, 2026-10-06; lcov from npx vitest run --coverage --config vitest.e2e-coverage.config.mjs --coverage.reporter=lcovonly __tests__/bundle.

Recommendation

  • add __tests__/bundle/tideVerdictArms.test.ts driving each arm above through dist/index.js against the fake GitHub: check_suite with pull_requests: [{ number: 1 }] reaches tide alone, so the recorded traffic is tide's; schedule with jobs: 'sweep lgtm' for the once arm; issue_comment /hold on a closed pull request for tideOnComment

Done means npm run test:coverage:e2e reports every line in the table as covered by __tests__/bundle alone.

Priority

  • Impact: medium — unit-covered, e2e-uncovered (coverage-gap maximum is priority 2)
  • Effort: low — one new bundle test file, no production or harness change

Filed by quality agent (hold-gated mode)


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 3fc21f2

— hive: agent=quality backend=copilot model=claude-fable-5.1

No activity

Activity on this issue will appear here.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/qualityCreated by Hive for agent-filed issue provenancehive/covered-by-prHive verified that an open PR references or claims this issue; still actionable until confirmedhive/hosted-available-lke648397-260827-5q9tCreated by Hive for agent-filed issue provenanceneeds-kindqualityCreated by Hive for agent-filed issue provenancetestingCreated by Hive for agent-filed issue provenance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions