fix(skill-tree): harvest diffs via githubkit, not the gh CLI#463
Merged
Conversation
The harvest hook fetched the merged PR diff with `gh pr diff` (subprocess), but forge-loop deliberately does NOT use the gh CLI and the loop exports a GH_TOKEN that breaks it — so harvest would silently no-op in production (green tests, dead feature). Switch to `gh_issues.pr_diff(pr_url, repo)` (githubkit), keyed off the PR URL the merged outcome already carries rather than the issue number. - harvest_skills_from_merge: fetch_diff is now Callable[[str], str] (pr_url -> diff); skips outcomes without a PR URL; idempotent per PR URL. - provenance is `pr:<url>` (PullRequest carries no merge SHA); HarvestedSkill and SkillHarvestedEvent carry `pr_url`/`pr` instead of `sha`. Recipe freshness is held by skill-key supersession; SHA/age expiry of harvested cards is a noted follow-up. 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.
Follow-up to #462. Makes harvest actually work on a live loop.
Problem (green tests, dead feature): the post-merge harvest fetched the PR diff with
gh pr diff(subprocess). forge-loop deliberately does not use the gh CLI, and the loop exports aGH_TOKENthat breaks it — so on the real loop harvest would silently no-op and the tree would never populate.Fix: fetch via
gh_issues.pr_diff(pr_url, repo)(forge-loop's githubkit client), keyed off the PR URL the merged outcome already carries (not the issue number). Provenance becomespr:<url>(thePullRequestshape carries no merge SHA). Recipe freshness is held by skill-key supersession; commit-SHA-based age/expiry of harvested cards is a noted follow-up.42 skill tests green, lint clean.