Skip to content

Feat/reviewer context 144 - #2

Merged
selyafi merged 7 commits into
mainfrom
feat/reviewer-context-144
Jun 10, 2026
Merged

Feat/reviewer context 144#2
selyafi merged 7 commits into
mainfrom
feat/reviewer-context-144

Conversation

@selyafi

@selyafi selyafi commented Jun 10, 2026

Copy link
Copy Markdown
Owner

No description provided.

selyafi and others added 7 commits June 9, 2026 16:04
…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>
…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>
@selyafi
selyafi merged commit 6b9f5d7 into main Jun 10, 2026
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.

1 participant