4 months ago
ef9b797live-test surprise #3: a creds outage left needs_review comment/check actions stuck at status=recorded — the neutral check never reached GitHub, the stale comment stood, no retry. follow-on finding: two moderation items on one PR decided out of order, an older run's approve upsert overwrote the blocked comment (runs are per-SHA, the comment is per-PR, last write won). - sweep-actions job (scheduled every minute): re-attempts recorded actions once creds recover; idempotency keys make retries safe; age-windowed (retry after ~2m, abandon after ~60m + loud log) — migration-free attempt cap - staleness guard: a completed run with a newer same-kind surface row supersedes the older recorded row (deny-resume no longer overwritten by stale needs_review) - comment ownership: only the LATEST run for a change request executes its comment; non-latest runs still emit their per-SHA check, comment superseded. enforced in emitPrSurface (initial + resume) AND the sweeper - boot health: checkAppCredentials (GitHub GET /app via app JWT) + ai-review creds logged loudly at worker startup; does not refuse to start - run_actions gains a `superseded` status (text col, no migration) - integration tests: recover→executed; verdict-moved-on→superseded; ownership (decide older run after newer → older comment superseded, check updates) checks: biome clean · 12/12 typecheck · boundaries ok · 141 tests, 0 fail
Parentc485503