Feat/reviewer context 144 - #2
Merged
Merged
Conversation
…ping (diffsmith-144) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ts (diffsmith-144) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…iew prompt (diffsmith-144)
…iteria (diffsmith-144) Wires the GitHub provider into the context model added earlier on this branch. - Fetch now requests `body` in the existing `gh pr view --json` call (no extra request) and maps it to ReviewInput.Description. - New FetchLinkedIssues implements review.LinkedIssueFetcher: resolve the issues the PR closes via `gh pr view --json closingIssuesReferences`, then read each issue's title/body via `gh issue view` (the refs carry only number/url/repository — see the gh-closing-issues-refs shape). Failure contract honored: a failed closing-refs query is total (returned as err for the caller to surface as one note); a per-issue fetch/decode failure is non-fatal (issue dropped, note appended) so one inaccessible cross-repo issue can't sink the rest. TDD: description-captured test (+ asserts body is requested); linked-issue happy path, non-fatal per-issue drop with note, total-failure-as-err, and no-refs-empty. Updated the happy-path arg assertion for the new --json field. Full suite + vet green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…criteria (diffsmith-144) Mirrors the GitHub provider's context wiring for GitLab. - Fetch now decodes the `description` the `glab mr view --output json` response already returns (previously discarded) into ReviewInput.Description. No arg change — the field was always present. - New FetchLinkedIssues implements review.LinkedIssueFetcher via the closes_issues API (`glab api projects/:enc/merge_requests/:iid/closes_issues`). GitLab returns title + description + web_url in that single call, so — unlike GitHub — there is no per-issue follow-up and thus no per-issue failure mode: a failed call is total (returned as err). Project path is URL-encoded for nested groups; --hostname is derived from the MR URL so self-hosted instances resolve correctly. TDD: description-captured test; closes_issues happy path (asserts the encoded api path + --hostname), nested-group path encoding, total-failure- as-err, and no-issues-empty. Full suite + vet green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…fsmith-144) Final piece of 144 — ties the providers' Description/FetchLinkedIssues into the review pipeline so the model actually sees the # Intent section. - New enrichWithContext helper: after Fetch, type-asserts the provider to review.LinkedIssueFetcher and (unless --no-context) resolves acceptance criteria, then bounds everything via CapContext. Enrichment is never a gate — a total fetch failure becomes one surfaced note and the review proceeds with no criteria; non-fatal fetcher notes and truncations are passed through. - New --no-context flag: strips the description from the prompt and skips the linked-issue fetch entirely (no extra network call, nothing extra reaches the model). - Wired into both the TUI pipeline and the --print-prompt/--dry-run path so the printed prompt reflects exactly what the model will see; print- path notes go to stderr to keep stdout a clean prompt. - buildRunSummary gains a contextNotes argument and surfaces them on a "Context:" line across all synthesis paths, so a dropped/truncated description or criterion is never silently lost. TDD: enrichWithContext (no-context strip, criteria populate, non-fatal fetch-error note, fetcher-note passthrough, nil-fetcher-still-caps) and buildRunSummary context-note rendering. Updated the strict-argv GitLab print-prompt test for the new closes_issues call. Full suite + vet green. End-to-end 144 now complete: providers populate description + acceptance criteria, enrichment caps + surfaces notes, BuildPrompt renders # Intent (untrusted-fenced), --no-context opts out. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…-144) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.