Repository navigation
fix(ci): push dev-agent commits with the App token, not GITHUB_TOKEN - #313
Conversation
Revise-mode pushes were authenticated as GITHUB_TOKEN, which GitHub attributes to actor github-actions[bot] on the resulting `pull_request: synchronize` event. That leaves the PR's checks stuck on action_required with zero jobs ever created, even for a same-repo, non-fork PR — starving every QA revision round of CI signal. The initial PR-open push never hit this because gh pr create (already on the App token) is what's attributed to the `opened` event, not whichever token pushed the branch. Route every git push through the App token instead, matching that already-working identity. Closes #311
📱 iOS Build Status: PASSED✅ iOS Simulator Build & Unit Tests - success iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those. |
QA verification — PR #313 vs issue #311Issue type: bug report (no acceptance checklist) → checklist is "repro no longer reproduces + regression proof." Root-cause fix check — PASSIssue #311 pinned the cause precisely: revise-mode Verified in the diff (
Tests — no test required, correctly soThis is a Regression / behavioral confirmation — partially observed, as expectedThis PR's own initial push already went through AGENTS.md conventions — PASSNo test needed (exempt, see above). Branch naming ( VerdictFix correctly and completely implements the chosen approach from the issue's own fix list, is internally consistent (both push sites covered, comment and prompt text agree), doesn't overreach into the explicitly-deferred root-cause investigation or self-heal work, and needs no unit test per this repo's own conventions. Full confirmation of the actual behavioral claim is necessarily deferred to a live revise-mode push, which the PR discloses rather than hides. QA verdict: PASS |
There was a problem hiding this comment.
Principal review — PR #313
Verdict: human-merge — risk:high is correctly applied (diff touches .github/workflows/**, a sensitive_paths entry in .github/agent-policy.yml), so this always routes to a human regardless of findings below. Label isn't stale: the one commit (1ecedcb, 07:01:46Z) predates the risk:high label (07:14:17Z) and nothing has landed since.
Verification performed
- Read the full diff (
gh pr diff 313) — it is a comment-block + agent-prompt-text change only, no literal shellgit pushexists anywhere in this file (confirmed viagrep -n "git push"across.github/workflows/*.yml); the actual push-token selection is entirely LLM-prompt-driven, same mechanism the pre-existing "workflow-file-diff exception" already used — this PR just widens it to unconditional. Consistent with how QA characterized it. python3 -c "import yaml; yaml.safe_load(...)"— parses cleanly, matches the PR description's claim.- Confirmed neither
dev-agent.yml,qa-agent.yml, norprincipal-review.ymltrigger onpush/synchronize(all three arelabeled-only +workflow_dispatch) — the "no self-loop" claim in the new comment holds. gh pr checks 313— iOS build, JVM tests, iOS UI tests allpass; this PR's own initial push (viagh pr create→ App token, pre-existing behavior) never hit the bug described in #311, as the PR body itself acknowledges.- Read issue #311 in full — the fix implements option (b) from its own "Possible fixes" list verbatim, correctly defers option (a) (root-causing the repo/org setting) and the self-heal routine as out of scope, matches the PR description.
- Checked
principal-review.yml'sgit push origin dev(the only other literalgit pushin.github/workflows/) — that's a direct push todevfor the audit-log commit, unrelated to the PR-branchsynchronize-attribution bug this PR fixes. Correctly left untouched.
Finding (minor, confirmed)
.github/workflows/dev-agent.yml (new comment, ~L325-328): "jvm-tests.yml/ios-app-build.yml's own on: push triggers are scoped to dev/main only (issue #244)" — this is factually wrong for ios-app-build.yml. Its actual trigger (.github/workflows/ios-app-build.yml:7-11) is push: branches: [dev, feat/v3-ios-port] — no main, plus an extra branch not covered by the "dev/main" characterization. Issue #244 itself says so explicitly: "Note ios-app-build.yml already does this correctly (push limited to dev and feat/v3-ios-port)." jvm-tests.yml is correctly dev/main — only the conflation of the two files under one description is wrong.
This doesn't affect the correctness of the fix itself (no fix/*/feature/* dev-agent branch will ever literally collide with feat/v3-ios-port, so the "no redundant run" conclusion still holds in practice), but this repo's own convention treats these justification comments as load-bearing ground truth (agents and humans both read them at face value, per the extensive precedent throughout this file citing exact issue numbers). Worth a one-line correction before merge — e.g. "jvm-tests.yml is scoped to dev/main; ios-app-build.yml to dev/feat/v3-ios-port — neither overlaps a fix/*/feature/* branch (issue #244)."
Everything else
- No new networking dependency/call introduced.
- No other
sensitive_pathsentries touched. - AGENTS.md's "comment fixes" test exemption correctly applies (no executable logic changed) — QA's assessment checks out.
- Behavioral confirmation of the actual #311 fix is (as the PR discloses) still pending a live revise-mode push; nothing here to disprove it, and there's no way to test it earlier than that.
Routing to human-merge on the risk:high label as required; the one confirmed finding above is minor and non-blocking on its own but should be fixed while a human is already here for the sensitive-path review.
|
Reviewed directly: this is a comment/prompt-text-only change extending the already-trusted |
…erage Addresses the QA-agent's blocking finding on the re-review of PR #310 (#309): commit 0057aee fixed a real principal-review-confirmed bug (the scrub bar called appState.seek(to:), and therefore syncNowPlayingInfo(), on every drag frame) but shipped with zero test coverage — no regression guard that would fail against the pre-fix behavior. Pulls the drag/commit decision out of PlayerView into PlayerScrubberState, a plain, SwiftUI-free struct: displayValue(elapsedSeconds:) for what the slider/label should show, updateDragValue(_:) for per-frame drag updates (local only, no seek), and editingChanged(_:elapsedSeconds:) mirroring Slider's onEditingChanged — returns the value to commit via appState.seek(to:) only on the drag-ended transition, nil otherwise. PlayerView now just holds one @State PlayerScrubberState and forwards Slider's callbacks into it; behavior is unchanged. New PlayerScrubberStateTests covers: display tracks live playback while not dragging, drag start seeds from current position (not a stale 0), per-frame drag updates never touch playback, drag end commits exactly once with the final dragged-to value, display resumes following live playback after the drag ends (so a remote/Control Center command during a drag still shows up once released), and a full simulated drag gesture commits exactly once — the direct regression guard for the original bug. Merged origin/dev in first to pick up #313's dev-agent.yml fix (this branch's copy was stale enough that GitHub's own anti-tampering check on pull_request + id-token: write workflows was blocking OIDC minting, skipping the automated QA retry — see issue #254). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…rol Center (#310) * feat(ios): wire MPNowPlayingInfoCenter/MPRemoteCommandCenter for Control Center AppState now publishes book/chapter/elapsed/rate metadata to Control Center/the lock screen on start/pause/resume/seek/chapter-change/speed-change, and routes the system's play/pause/skip commands back into the existing playback controls, reusing whatever real cover art is already cached. Real MediaPlayer calls (SystemNowPlayingManager) are guarded off under XCTest, mirroring TTSEngineBridge/AudioPlaybackEngine's existing isRunningUnderXCTest pattern for AVAudioSession/AVSpeechSynthesizer, since MPNowPlayingInfoCenter/MPRemoteCommandCenter talk to a similar system daemon and there's no local Simulator available here to confirm that's safe in the headless CI Simulator. Closes #309 * fix(ios): don't let playbackSpeed's Now Playing sync fire before nowPlayingBook is set The dev-agent's run for #309 crashed on max_turns (90) after opening this PR with real, substantial content — not a bug in itself, but CI caught 3 real test failures in AppStateNowPlayingTests, all an identical off-by-one in clearCallCount. Root cause: startPlayback's isNewSession branch did `playbackSpeed = defaultPlaybackSpeed` *before* `nowPlayingBook = book`. playbackSpeed's didSet now also runs `defer { syncNowPlayingInfo() }` (this PR's own change) — so that reassignment fired the sync while nowPlayingBook still pointed at the previous session (or nil, on the very first startPlayback ever), reading a stale/absent book and spuriously clearing Control Center — one extra clear() call before this function's own trailing sync ran moments later with the correct book. Three tests caught it: starting an unsupported format while another book plays (expected 0 clears, got 1), stopPlayback (expected 1, got 2), and sleep-timer expiry (expected 0, got 1) — each off by exactly the one spurious clear from the *preceding* startPlayback call. Fix: move the `playbackSpeed = defaultPlaybackSpeed` reset to after `nowPlayingBook = book`, still gated on isNewSession exactly as before — doesn't change what speed gets applied or when it's consumed later in the function, only ensures the didSet observes a consistent nowPlayingBook when it fires. Verified by static trace against all 17 AppStateNowPlayingTests cases (not executed — no local Xcode/Simulator in this environment); pushing for CI to confirm. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix(ios): suppress playbackSpeed's didSet during startPlayback's default-speed seeding Amends the previous commit — that fix (reordering nowPlayingBook before the playbackSpeed reset) cleared the 3 original AppStateNowPlayingTests failures but introduced a new, CI-caught regression: for an audio book, playbackSpeed's didSet now saw a real nowPlayingBook at seed time and called audioEngine.setRate() redundantly, right before startAudioPlayback's own play(rate:) call moments later — testChangingSpeedForAnAudioBookApplies- ItLiveWithoutRecomputingDuration expected setRateCalls == [2.0] but got [1.0, 2.0]. Root problem either way: startPlayback's `playbackSpeed = defaultPlaybackSpeed` is bookkeeping (seeding a new session), not a live speed change — it shouldn't run playbackSpeed's didSet's side effects (setRate, Now Playing sync) at all, regardless of exactly when nowPlayingBook happens to get set relative to it. Reverts the reordering and instead adds isSeedingPlaybackSpeedForNewSession, set true only around that one assignment, which the didSet checks first and bails out on entirely. startPlayback's own trailing `defer { syncNowPlayingInfo() }` already publishes the real, final state once setup finishes, and startAudioPlayback's play(rate:) already applies the real rate — neither needs anything from the seeding didSet run. Traced by hand against all 17 AppStateNowPlayingTests + the playbackSpeed sections of AppStatePlaybackTests/AppStateAudioPlaybackTests (not executed — no local Xcode/Simulator in this environment); pushing for CI to confirm. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix(ios): scrub bar now seeks/syncs Now Playing only on drag end, not every frame Addresses the principal-review CONFIRMED finding on PR #310: PlayerView's Slider was bound directly to appState.seek(to:) via a plain Binding<Double>, which SwiftUI calls continuously (many times per second) while the thumb is being dragged — and seek(to:) now also calls syncNowPlayingInfo(), doing a synchronous cover-art disk read plus setting MPNowPlayingInfoCenter. nowPlayingInfo and reassigning the skip-command intervals (an IPC round-trip to nowplayingd) on every single one of those calls. Real, user-visible jank on the one control most likely to be dragged rapidly and continuously. Tracks the drag's own live position in local @State (scrubberDragValue/ isDraggingScrubber) via Slider's onEditingChanged, and only calls appState.seek(to:) once, when the drag ends. The displayed value (both the slider thumb and the elapsed-time label) still tracks appState.elapsedSeconds live whenever the user isn't actively dragging, so external changes (skip buttons, a remote command) still show up immediately. Correct per syncNowPlayingInfo's own existing rationale: the system interpolates elapsed time between updates using the reported playback rate, so it never needed per-frame precision to begin with. No AppState changes — the fix is entirely in how PlayerView drives seek(to:). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * test(ios): extract PlayerScrubberState so the drag/commit fix has coverage Addresses the QA-agent's blocking finding on the re-review of PR #310 (#309): commit 0057aee fixed a real principal-review-confirmed bug (the scrub bar called appState.seek(to:), and therefore syncNowPlayingInfo(), on every drag frame) but shipped with zero test coverage — no regression guard that would fail against the pre-fix behavior. Pulls the drag/commit decision out of PlayerView into PlayerScrubberState, a plain, SwiftUI-free struct: displayValue(elapsedSeconds:) for what the slider/label should show, updateDragValue(_:) for per-frame drag updates (local only, no seek), and editingChanged(_:elapsedSeconds:) mirroring Slider's onEditingChanged — returns the value to commit via appState.seek(to:) only on the drag-ended transition, nil otherwise. PlayerView now just holds one @State PlayerScrubberState and forwards Slider's callbacks into it; behavior is unchanged. New PlayerScrubberStateTests covers: display tracks live playback while not dragging, drag start seeds from current position (not a stale 0), per-frame drag updates never touch playback, drag end commits exactly once with the final dragged-to value, display resumes following live playback after the drag ends (so a remote/Control Center command during a drag still shows up once released), and a full simulated drag gesture commits exactly once — the direct regression guard for the original bug. Merged origin/dev in first to pick up #313's dev-agent.yml fix (this branch's copy was stale enough that GitHub's own anti-tampering check on pull_request + id-token: write workflows was blocking OIDC minting, skipping the automated QA retry — see issue #254). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: LibraVault <rob@libravault.xyz> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
What
dev-agent.yml's revise-modegit push(the commit(s) pushed when QA sends a PR back for fixes) was authenticated as the defaultGITHUB_TOKEN. GitHub attributes the resultingpull_request: synchronizeevent to actorgithub-actions[bot], and that push's checks (iOS App Build & Test,JVM Tests,UI Tests (Emulator)) then land onaction_requiredwith zero jobs ever created — even though the PR is same-repo, not a fork. This silently starves every QA revision round of CI signal (confirmed live on PRs #257 and #284).The initial PR-open push never hit this: the
openedevent is attributed to whichever call actually created the PR (gh pr create, already routed throughAPP_GH_TOKEN), not to whichever token pushed the branch first.Fix
Route every
git pushdev-agent performs — both the initial triage-mode branch push and every revise-mode push — through the pipeline App token (APP_GH_TOKEN) instead of the defaultGITHUB_TOKEN, matching the identity that's already known to work for PR creation. This is the "sidestep the setting" option from the issue rather than the "find and fix the repo/org approval setting" option — it doesn't require confirming which specific setting is responsible, and it reuses a token/pattern already in place for the workflow-file-diff case.Out of scope (left for follow-up, per the issue's "Possible fixes" list)
action_requiredwith zero jobs and self-heals by approving the run. That needs a real user token (per the issue, neitherGITHUB_TOKENnorAPP_GH_TOKENcan call the approve-run API themselves) — wiring a personal credential into the pipeline is a bigger decision than this fix, and out of scope here.Risk
risk:high by path — this touches
.github/workflows/**(agent-policy.yml'ssensitive_paths), so it will always route to human merge regardless of what QA/principal-review conclude. Flagging explicitly per the dev-agent persona's instruction to call this out rather than leave it for the diff alone to explain.Testing
No unit-test framework applies to GitHub Actions workflow YAML in this repo (no Kotlin/JVM code changed, so
./gradlew testDebugUnitTestis a no-op for this diff). Verifiedpython3 -c "import yaml; yaml.safe_load(...)"parses the edited file cleanly. The real test is behavioral and already underway: this very PR's own creation push and (if QA requests changes) any revision push are the first live exercises of the new path — a revise-mode push landing withpull_request: synchronizechecks actually queued (notaction_required/zero jobs) will be direct confirmation the fix works, and a repeat of the stuck-checks symptom will disprove the hypothesis.Closes #311