feat(release): implement release-context and decouple context generation#2
Merged
JacksonFergusonDev merged 2 commits intomainfrom May 2, 2026
Merged
feat(release): implement release-context and decouple context generation#2JacksonFergusonDev merged 2 commits intomainfrom
release-context and decouple context generation#2JacksonFergusonDev merged 2 commits intomainfrom
Conversation
Decouples the repository context generation from the clipboard extraction pipeline. The logic from `libexec/context` has been migrated to `lib/core.sh` as `generate_project_context()`. This prevents the `output_and_copy` function from hijacking stdout when context generation is composed inside other commands, allowing tools like `release-context` to safely prepend the project blueprint to their payloads without overwriting the system clipboard twice.
Introduces `focal release-context`, a new extractor that fetches all PRs merged since the most recent Git tag and formats them into an LLM-optimized markdown document. - Automatically resolves the temporal boundary via `git log` and tags. - Uses `gh` to fetch high-signal PR metadata (title, body, author, labels). - Aggressively filters out standard bot accounts (Renovate, Dependabot, GitHub Actions) at the query level to preserve token bandwidth. - Strips hidden HTML comments (e.g., ) from PR bodies. - Prepends the macroscopic project context (tree, git status, manifests) to anchor the LLM's understanding of the repository architecture.
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.
Overview
This PR introduces the
focal release-contextcommand, designed to extract high-signal repository changes for LLM-assisted release note synthesis.Unlike strict changelog generators (e.g.,
git-cliff), this pipeline feeds the LLM the human-authored intents of merged PRs, strictly excluding raw code diffs and automated dependency bumps to maximize attention window efficiency.Architectural Changes
libexec/contextand intolib/core.shasgenerate_project_context(). This resolves a pipeline quirk whereoutput_and_copywould overwrite the clipboard prematurely if invoked as a subshell$().release-contextbash wrapper dynamically resolves the temporal boundary (latest tag to HEAD) and passes it to theghCLI. The query strictly excludesapp/renovate,dependabot, andgithub-actionsauthors to prevent massive upstream changelogs from polluting the LLM's context window.gh_release_context.py): * Parses the JSON payload fromgh.focal context) with the PR timeline, giving the LLM a complete understanding of both the system state and the delta.Validation
focal contextstill operates correctly as a standalone command.