Repository navigation
Description
Found during principal review of PR #412 (feat(android): full Player-screen parity for Read Aloud / TTS, issue #138), running as a manual stand-in for principal-review.yml per issue #455.
What happened
PR #412 reached status:needs-review (past QA) while still flagged isDraft: true on GitHub. jvm-tests.yml's Unit & Integration Tests (JVM) job (and ios-app-build.yml's equivalent real build/test jobs) are deliberately gated on github.event.pull_request.draft == false — a legitimate cost-saving guard for a still-in-progress draft (see those workflows' own comments). But nothing re-checks that gate once a PR is actually done and has moved past QA into review: the push-triggered CI run for this PR's final (rebased) commit (run 32629688256) shows Detect Changed Paths succeeding but Unit & Integration Tests (JVM) itself skipped, purely because the PR was still a draft — even though the diff clearly touches core/tts/feature/reader and should have triggered a real run. The workflow's overall conclusion still reads success (a skipped job doesn't fail the workflow), which reads as "CI passed" at a glance when in fact the real test suite never executed on GitHub's infrastructure for this commit.
Root cause
Same underlying trigger as issue #388 (still open): PR #412's dev-agent run crashed (turn-budget exhaustion, confirmed via job logs — see PR #412's own comment history) three times before a human recovered it by hand-relabeling status:escalated → status:needs-qa directly. The crashed run's own end-of-run tail step is the only place that both applies the risk:* label (per #388) and calls gh pr ready to take the PR out of draft (dev-agent.yml line ~679, .claude/agents/dev-agent.md's "mark it ready for review" step). The manual recovery path filled in the missing QA/review labels but didn't reproduce either of those two tail-step side effects, so the PR silently carried both gaps (#388's missing risk label, and this issue's still-draft state) all the way to status:needs-review.
Why this matters
A PR can reach the very last automated gate (principal review) — and in a differently-timed run, get auto-merged — having never actually had its real test suite or build run in CI, with the workflow's own status check still showing green. The only reason this was caught here is a human reviewer independently running the test suite locally and separately noticing the still-draft flag; nothing in the pipeline itself would have surfaced it.
What I did for PR #412
Ran gh pr ready 412 to take it out of draft (triggering a real ready_for_review CI run) and independently reran :feature:reader:testDebugUnitTest :core:tts:testDebugUnitTest myself in a matching worktree at the PR's exact HEAD commit — genuinely 0 failures across all relevant suites (86 tests total across ReaderViewModelTest, EpubReaderViewModelTest, MarkdownReaderViewModelTest, TtsDurationEstimatorTest, ReadAloudSleepTimerTest), so the code itself is fine. This issue is the permanent record for the pipeline gap that let it get this far unnoticed, not a report of broken functionality in #412 itself.
Suggested fix
Either (a) qa-agent.yml or principal-review.yml should backstop by calling gh pr ready (mirroring classify_pr_risk.py's existing backstop pattern suggested in #388) whenever it picks up a PR that's still marked draft, or (b) the same manual-recovery guidance #388 recommends (re-run the dev-agent's tail-step side effects explicitly when hand-relabeling past a crash) should explicitly include gh pr ready, not just risk classification.
Activity