[AI:Task] T20260705-94A14772: Split closed-pr-recovery.ts under the 200 code-line cap by extracting rejection-issue creation - #49
Open
dzykovic wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR reduces the size/complexity of the rejection-handling composer by extracting cohesive helper logic into shared modules under engine/pipeline/composers/_shared/, keeping closed-pr-recovery.ts focused on orchestration while preserving existing behavior.
Changes:
- Extracted manual “rejection issue” templating + tracker issue creation into
_shared/rejection-issue.ts. - Extracted work-item reopen frontmatter rewrite into
_shared/reopen-work-item.ts. - Extracted diagnoser-agent invocation + parsing into
_shared/rejection-diagnoser.tsand updated the composer to use it, with new unit tests for rejection-issue helpers.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| engine/pipeline/composers/closed-pr-recovery.ts | Replaces in-file helper implementations with imports from _shared/*, keeping orchestration and decision logic in place. |
| engine/pipeline/composers/_shared/reopen-work-item.ts | New shared helper to rewrite work-item frontmatter for reopen + sync to DB. |
| engine/pipeline/composers/_shared/rejection-issue.ts | New shared helper for loading rejected-issue-body.md and creating a manual tracker work item. |
| engine/pipeline/composers/_shared/rejection-issue.test.ts | Adds focused unit tests for template loading + tracker issue creation behaviors. |
| engine/pipeline/composers/_shared/rejection-diagnoser.ts | New shared helper for running the diagnoser agent and extracting the recommendation: result. |
| .operator/data/tasks/T20260705-94A14772.md | Marks the task as completed and records completed_at. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Task T20260705-94A14772: Split closed-pr-recovery.ts under the 200 code-line cap by extracting rejection-issue creation
Priority: 4 | Parent: F20260705-CC7FF1B9
Summary
Problem
engine/pipeline/composers/closed-pr-recovery.tsis 376 total / ~293 codelines (excluding logging/comments/JSDoc) — well over the
engine/pipeline/**≤200 cap.
A cohesive seam is the manual-issue creation path:
loadRejectedIssueTemplate(303-319) +createRejectionIssue(321-360),~57 lines that deal only with tracker-issue templating and creation.
Solution
Extract
loadRejectedIssueTemplate+createRejectionIssueintoengine/pipeline/composers/_shared/rejection-issue.ts(named exports takingthe narrow deps they use), with a colocated
rejection-issue.test.ts.processItemcalls the extractedcreateRejectionIssue. If the file is stillmarginally over, additionally extract the
reopenItemfrontmatter-rewritehelper (
267-295).Behavior-preserving: the reopen/reject/duplicate decision logic and MAX_REOPENS
cap stay in
closed-pr-recovery.ts. Keep all logging intact.Affected Files
engine/pipeline/composers/closed-pr-recovery.ts:303-360— remove the two functions, import themengine/pipeline/composers/_shared/rejection-issue.ts— new: extracted template load + issue creation[…truncated]
Automated by AI Automation Pipeline. Current state is tracked via the PR
label (
ai:processing,ai:in-review,ai:ready-to-merge,ai:failed) and thePR comments — not this description.