Skip to content

Record what settled each finding and the reactions on it - #53

Merged
TorstenDittmann merged 1 commit into
mainfrom
claude/project-thread-qtf7fe
Nov 18, 2026
Merged

TorstenDittmann merged 1 commit into
mainfrom
claude/project-thread-qtf7fe

Conversation

@TorstenDittmann

@TorstenDittmann TorstenDittmann commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Torsten · project thread

What

Hansi now reports what happened to each finding, so Appwrite can tell which findings were useful.

What settled it. Findings already move to resolved or dismissed, but nothing recorded what settled them. Every settlement now sends a settlement:

  • commit: a later commit fixed it (review job)
  • chat: the author said it is fixed, or it was declined, in its thread (chat mark_finding)
  • thread: a maintainer resolved the thread without a change (syncFindingsWithThreads, formerly dismissFindingsResolvedOnGitHub)

Reactions. ReviewThread gains optional reactions (👍/👎 on the root comment). The GitHub client reads them in the same GraphQL query that already lists threads (reactionGroups on the first comment), so a review costs no extra call. At the start of every review, and after each chat answer, the counts that changed since last stored go to the new ResultsSink.updateReactions. A failure to store them only logs. Clients that don't read reactions (GitLab, Bitbucket, Gitea, Origin) leave the field out, and nothing is written for them.

Appwrite sink. updateFindings passes settlement through; updateReactions sends PATCH /reviews/repositories/:id/pulls/:n/findings/reactions in batches of 100. listFindings reads settlement (empty means open), upvotes and downvotes, and leaves them out against an Appwrite that doesn't return them yet.

Known gap: GitHub sends no webhook for reactions, so a 👍 added after the pull request's last review or chat is not picked up.

Test plan

All against the in-memory fakes and local servers, no real provider API:

  • review-job.test.ts: a later commit fixing a finding records settlement: 'commit' and the 👍 read at the start of that review, written once. A thread resolved by a maintainer records settlement: 'thread' and their 👎.
  • chat-job.test.ts: a chat dismissal records settlement: 'chat'.
  • resolved-threads.test.ts: reactionChanges writes only changed counts, treats counts missing from an older Appwrite as 0, and skips threads without reactions read.
  • github/pulls.test.ts: 👍/👎 parsed from reactionGroups (fixture).
  • appwrite/results.test.ts: wire format of the settlement, reactions batching, and reading settlement back.
  • bun run lint, bun run check and bun run test (455 pass) pass.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_01F3M7tvvVXXtaPKh5pzVnt3

Findings already move to resolved or dismissed, but not what settled
them, so a finding fixed in a later commit could not be told from one
the author said was fixed in its thread, or one a maintainer declined by
resolving the thread. Each settlement now carries `settlement`: commit,
chat or thread.

The 👍 and 👎 on a finding's comment are read with the review threads
GitHub already returns at the start of every review, and again after a
chat answer, and stored where they changed through the new
updateReactions sink call. A failure to store them only logs.

Together they let Appwrite tell which findings were useful.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F3M7tvvVXXtaPKh5pzVnt3
Co-authored-by: Torsten Dittmann <1759475+TorstenDittmann@users.noreply.github.com>
@appwrite

appwrite Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

The engine now records whether findings were settled by a commit, a chat, or a resolved thread, and synchronizes changed 👍/👎 counts. The Appwrite sink reads and writes these fields, while the GitHub client fetches reaction counts with its existing review-thread query.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 13
File Change
packages/appwrite/src/results.test.ts Covers reading and writing settlement data and batched reaction updates.
packages/appwrite/src/results.ts Passes settlement through and adds batched reaction writes.
packages/engine/src/chat-job.test.ts Asserts chat settlements are recorded.
packages/engine/src/chat-job.ts Marks chat settlements and records reactions after answering.
packages/engine/src/github.ts Adds optional reaction counts to the review-thread contract.
packages/engine/src/resolved-threads.test.ts Tests detection of changed reaction counts.
packages/engine/src/resolved-threads.ts Synchronizes thread settlements and changed reactions.
packages/engine/src/results.ts Adds settlement and reaction fields to finding and sink contracts.
packages/engine/src/review-job.test.ts Covers commit and thread settlements with stored reaction counts.
packages/engine/src/review-job.ts Records commit settlements and syncs threads at review start.
packages/engine/src/testing.ts Extends in-memory sinks and GitHub fakes for settlement and reactions.
packages/github/src/pulls.test.ts Covers parsing reaction counts from GitHub review-thread data.
packages/github/src/pulls.ts Fetches root-comment reaction counts in the review-thread query.
🔇 Filtered out · 1

Findings Hansi considered but did not post.

Finding Why
Skip reaction scans for providers that cannot read reactions Verifier: This is a minor performance concern, not a bug. The extra thread listing is wrapped in try/catch and never throws. The existing resolved-thread sync (resolved-threads.ts:73) already lists threads the same way on every job. The suggestion hardcodes provider === 'github' in the engine, which is meant to depend only on the provider contracts. The client contract already marks reactions as optional, so a client that gains reaction support would be skipped by the hardcoded check.

Reviewed a402d3b · Details · Comment @appwrite review to re-run, or mention @appwrite with a question.

@appwrite appwrite Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Tier S · Looks good to merge. Summary

@TorstenDittmann
TorstenDittmann merged commit a8c7d23 into main Nov 18, 2026
4 checks passed
@TorstenDittmann
TorstenDittmann deleted the claude/project-thread-qtf7fe branch November 18, 2026 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants