feat: add idempotent GitHub issue creation from repo analysis - #43
Merged
Merged
Conversation
CleanupIssues.md creates/updates/closes GitHub issues for the top 5
file clusters from buildCleanupAnalysis(). Each issue body contains
a marker comment (<!-- ema-cleanup:{file} -->) for idempotent lookup.
Issues are labeled ema-cleanup and managed deterministically:
- No matching issue + file in top 5 → create
- Matching issue + file in top 5 → update title and body
- Matching issue + file NOT in top 5 → close with comment
Issue identity is driven by deterministic cluster data (file path,
score, violation count, co-occurring rules, category breakdown),
not LLM output. Local runs skip silently (no GITHUB_TOKEN).
Also adds issues:write permission to repo-analysis.yml and passes
GITHUB_TOKEN and GITHUB_REPOSITORY env vars to the analysis step.
PR #43: feat: add idempotent GitHub issue creation from repo analysis4 files, +183 / -1 Scope✅ PR scope looks good. Structural✅ No structural bloat detected. SlopStatic Analysis✅ Oxlint found no issues. CorrectnessNo extraneous code patterns detected. |
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.
What does this PR do?
Adds a
CleanupIssues.mdEMA component that creates, updates, and closes GitHub issues based on the top 5 file clusters from the deterministic repo analysis.Why?
The repo analysis pipeline produces actionable cleanup findings but they were trapped in a markdown report artifact. This closes the loop by creating trackable GitHub issues that reflect the current state of code health.
How idempotency works
Each issue body contains a marker:
<!-- ema-cleanup:{file} -->. On each run:Issue identity is driven by
buildCleanupAnalysis()— deterministic code, not LLM output. Running the analysis 10 times produces exactly 5 open issues (assuming same data).Changes
.reviews/components/CleanupIssues.md(new) — persist eval component with sequential GitHub API calls, marker-based idempotent lookup,ema-cleanuplabel management.reviews/components/RepoPolicyReport.md— adds<CleanupIssues>invocation after the report.github/workflows/repo-analysis.yml— addsissues: writepermission, passesGITHUB_TOKENandGITHUB_REPOSITORYenv varsspecs/code-review-agent-spec.md— documents §13.8 cleanup issues lifecycleScope confirmation
Verification