Repository navigation
feat(synthesis): feed the PR review thread into verified commit synthesis - #568
Merged
Merged
Conversation
…esis Phase 2 of #562. On the Critic-verified path only, fetch the merged PR's human review thread (conversation comments, review bodies, inline review comments; bots dropped) with one `gh api graphql` call and hand it to the model as its own fenced, labeled, untrusted DATA section, capped at 14000 chars. The query takes the newest messages (`last:`) and marks the thread truncated when GitHub holds older ones; the char cap keeps the opening and the end, where review converges. A thread failure keeps the description and trips a separate thread breaker, so a GraphQL-only problem never silences working description lookups. All four fences, and the PR title, are neutralized in untrusted text. The verifier is told to flag thread-drawn claims the diff does not show landed. Refs #562 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
🧠 Hunch — Engineering Memory Guard✅ This PR touches no recorded invariants (directly or via blast radius) and re-introduces nothing deliberately retired across 4 changed file(s). 📜 Hunch Constitution — 2 policy receipt(s)
|
davesheffer
merged commit Oct 29, 2026
99dac2e
into
feat/pr-context-synthesis
12 of 14 checks passed
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 2 of #562. Stacked on #563 (phase 1, PR description); merge after it.
What
On the Critic-verified synthesis path only (
verify/deep), Hunch now also fetches the merged PR's human review thread (conversation comments, review bodies, inline review comments) with onegh api graphqlcall, and passes it to the model as its own fenced, labeled, untrusted DATA section.__typename: Bot,[bot]logins, deleted authors). Messages sorted oldest first.last:);threadTruncatedis set when GitHub holds older messages. Rendered text capped at 14000 chars, keeping the opening and the end (where review converges), dropping the middle.HUNCH_PR_CONTEXT=0(no new env var).synth:… pr=#N+thread.ghis the user's own CLI, not an LLM API (con_2ce3f2a547 holds).Why only the verified path: the noise gate
Measured before building (material-error rate per claim, judged against the diff):
Cv/A = 0.70 (gate: ≤ 1.10), so the thread passes with verify. C/A = 0.89.
Observed failure mode: thread-fed records sometimes present a design the thread later dropped as the final decision; verify didn't always catch it.
Not measured
These changes target that failure mode but were not in the measured harness: chronological sort, the "proposals may have been revised or dropped; the DIFF shows what landed" framing, the verifier sentence, and the head+tail cut. Treat their effect as unmeasured.
Known limitation: if the verifier itself fails twice (
verify=failed), the thread-influenced draft is still written without a Critic audit. It shows in provenance (pr=#N+thread verify=failed), so it isn't silent.Review and checks
-Fcoerced all-digit owner/repo names to Int; the PR title could forge fences;first:plus a head-only cut dropped the end of long threads without marking them truncated. Its nits are also addressed: parsing and error classification are now pure, tested helpers (parseThreadAnswer,isNotFoundAnswer), and the thread breaker is separate.npm run typecheck: exit 0.node tooling/run-tests.mjs test/pr-context.test.ts test/env-surface.test.ts: 31/31, exit 0.truncated: true; a missing PR or repo resolves null.Refs #562
🤖 Generated with Claude Code