Home

boring / v2

publicBoring-Software-Inc/v2
Overview Code History Branches Pull requestsIssuesInsights Campfire Docs
main
HomeOverview Code PRsIssues

feat(worker): surface sweeper + comment ownership + boot health

4 months ago

ef9b797
Authored
grim7/12/2026, 12:34:57 AM
live-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

8 files changed
  • DECISIONS.md+33−0
  • apps/worker/src/index.ts+35−1
  • apps/worker/src/jobs/pr-surface.ts+22−1
  • apps/worker/src/jobs/sweep-actions.ts+150−0
  • apps/worker/src/sweep-actions.integration.test.ts+292−0
  • packages/db/src/services/runs.ts+105−1
  • packages/forge-github/src/client/auth.ts+25−0
  • packages/forge-github/src/index.ts+1
−0