Home

boring / v2

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

feat(forge-github): PR comment lifecycle — verdict transitions get a new comment

4 months ago

896b9ae
Authored
grim7/13/2026, 10:20:42 AM
incident (dither-kit#8): a blocked contributor fixed the change and the
comment was edited in place to "passed" — the receipts vanished and the
resolution landed at the top of a long thread where nobody reads. this
supersedes the "one comment, always upsert" decision.

- SAME verdict on a re-run ⇒ EDIT in place (unchanged, the common path).
- a verdict TRANSITION ⇒ a NEW comment after the commit, AND the previous
  comment marked superseded (struck text + a pointer; button/details/marker
  dropped). only transitions create comments — never a thread of them.
- RUN HISTORY is the single source of truth: the worker computes
  previousVerdict (getPreviousVerdict) and passes it to the adapter, which
  decides edit-vs-transition SOLELY from it. the marker is used ONLY to
  locate the active comment, never to infer what happened — so a
  human deleting/editing the comment can't desync the adapter from history.
  if a transition's old comment is gone, the resolution posts anyway with
  nothing to supersede, never silently a "first verdict".
- resolution copy knows the previous verdict (blocked→passed "that's
  cleared. good to merge.", etc.), from the same worker-supplied value.

same incident, second fix: a cleared block left a CHANGES_REQUESTED review
that can't self-edit and kept gating merge on required-review repos. on a
block→(pass|sent-to-review) transition the worker dismisses the outstanding
review (a new best-effort, idempotent dismiss-review action; adapter PUTs
the dismissal). comment ownership unchanged and now also gates the dismiss.

tests: same-verdict edits (ten re-runs = one comment) · transition
supersedes old + posts new · a transition whose old comment was DELETED
still posts (no supersede, no crash) · superseded golden · dismiss-review
PUT · the two decision queries over real postgres. goldens regenerated.
checks: typecheck all, biome, boundaries, 229 tests.

Parent8b250b5

12 files changed
  • DECISIONS.md+49−0
  • all-summaries.md+25−0
  • apps/worker/src/jobs/pr-surface.ts+52−6
  • packages/db/src/services/pr-surface.integration.test.ts+85−0
  • packages/db/src/services/runs.ts+55−1
  • packages/forge-github/src/actions/__snapshots__/actions.test.ts.snap+8−0
  • packages/forge-github/src/actions/actions.test.ts+145−15
  • packages/forge-github/src/actions/comment.ts
+72
−18
  • packages/forge-github/src/actions/execute.ts+14−0
  • packages/forge-github/src/copy.ts+55−7
  • packages/forge-github/src/index.ts+3−0
  • packages/forge/src/index.ts+20−0