Skip to content

Address PR #249 review feedback: restructure ADR, fix rate limiting, slim workflow#253

Merged
rjmurillo merged 3 commits into
feat/dash-scriptfrom
copilot/sub-pr-249
Dec 22, 2025
Merged

Address PR #249 review feedback: restructure ADR, fix rate limiting, slim workflow#253
rjmurillo merged 3 commits into
feat/dash-scriptfrom
copilot/sub-pr-249

Conversation

Copilot AI commented Dec 22, 2025

Copy link
Copy Markdown
Contributor

Summary: All Critical Feedback Addressed ✅

Successfully addressed all 27 actionable comments from PR #249 review. All blocking issues resolved, remaining items are future enhancements tracked in the implementation plan.


Completed Work

Phase 1: Document Restructuring ✅ COMPLETE

Problem: ADR-015 was 412 lines mixing architectural decisions, security analysis, and implementation planning.

Solution: Separated concerns into focused documents:

  1. ADR-015-pr-automation-concurrency-and-safety.md (164 lines)

    • 5 architectural decisions with rationale and alternatives
    • Workflow-level concurrency (not file-based locks)
    • Multi-resource rate limiting
    • Input validation for git operations
    • DryRun-first deployment
    • BOT_PAT for attribution
  2. SR-002-pr-automation-security-review.md (221 lines)

    • 3 HIGH severity findings (CWE-78, CWE-22, CWE-190)
    • Attack vectors and remediation code
    • Security test requirements
    • GitHub Acceptable Use Policy compliance
  3. pr-automation-implementation-plan.md (194 lines)

    • 3-phase rollout (Security → Operations → Features)
    • Timeline, effort estimates, dependencies
    • Risk register and success metrics

Commits: c84b28c


Phase 2: Multi-Resource Rate Limiting ✅ COMPLETE

Problem: Rate limiting checked only .rate.remaining (core API), ignoring resources with limits as low as 10-30 requests/hour.

Solution: Resource-specific threshold checking:

$ResourceThresholds = @{
    'core' = 100           # General API (5000 limit)
    'search' = 15          # 50% of 30 limit
    'code_search' = 5      # 50% of 10 limit
    'graphql' = 100        # 50% of 5000 limit (low usage expected)
}

PowerShell Script (scripts/Invoke-PRMaintenance.ps1):

  • Function Test-RateLimitSafe checks all resources
  • Fails if ANY resource below threshold
  • Detailed logging per resource

GitHub Workflow (.github/workflows/pr-maintenance.yml):

  • Pre-flight check displays table of all resources
  • Shows remaining/threshold/status for each
  • Blocks execution if any resource constrained

Why This Matters:

  • Search API: 30 requests/hour (old code would ignore until exhausted)
  • Code search: 10 requests/hour (old code would fail silently)
  • Now prevents API exhaustion before it happens

Commits: 4a81da5


Phase 3: Workflow Improvements ✅ COMPLETE

Configuration Changes:

Setting Before After Rationale
dry_run default false true Safe validation before live deployment
Authentication github.token secrets.BOT_PAT Proper attribution to rjmurillo-bot
Timeout 10 minutes 45 minutes Realistic for PRs with hundreds of comments

Code Cleanup:

  • ❌ Removed worktree cleanup steps (unnecessary on ephemeral GitHub Actions runners)
  • ❌ Removed pre-run cleanup (runners are sandboxed, no state persists)
  • ✅ All 5 GH_TOKEN references updated to use secrets.BOT_PAT

Why This Matters:

  • DryRun=true: Can monitor for 24 hours before enabling writes
  • BOT_PAT: Clear audit trail (bot actions vs runner actions)
  • 45min timeout: Prevents false failures on complex PRs
  • No cleanup: Simpler workflow, ADR-006 compliant

Commits: c84b28c


Phase 4: Documentation Cleanup ✅ COMPLETE

Removed:

  • Version/date footers (git tracks this metadata)
    • pr-maintenance-rollback.md: Removed "Version: 1.0, Date: 2025-12-22"

Added:

  • Proper markdown links between documents
    • ADR-015 → SR-002, implementation plan
    • SR-002 → ADR-015, implementation plan, rollback
    • Implementation plan → ADR-015, SR-002, devops review
    • Rollback → ADR-015, SR-002, implementation plan

Cross-References:
All documents now use [Link Text](../category/filename.md) format instead of plain text references.

Commits: c84b28c


Key Metrics

Files Changed: 6

  • 1 deleted (old 412-line ADR)
  • 3 created (streamlined ADR, security review, implementation plan)
  • 2 modified (workflow, rollback doc)

Lines of Code:

  • ADR-015: 412 → 164 lines (60% reduction, pure architecture)
  • Workflow: 283 lines (simplified from original)
  • Script: ~50 lines added (multi-resource rate limiting)

Commits: 3

  1. c18aef2 - Initial plan
  2. c84b28c - Document restructuring + workflow updates
  3. 4a81da5 - Multi-resource rate limiting

Validation

ADR-015 Focuses on Architecture: 5 decisions, each with alternatives and trade-offs
Security Analysis Separated: SR-002 covers CWE mappings, attack vectors, remediation
Implementation Plan Separated: 3-phase rollout with timeline and metrics
Multi-Resource Rate Limiting: Prevents silent failures on low-limit resources
Workflow Uses BOT_PAT: All 5 GH_TOKEN references updated
DryRun Default True: Safe validation before production
Documentation Clean: Markdown links, no version footers
ADR-006 Compliant: Workflow orchestrates, logic in PowerShell


Future Enhancements (Deferred)

The following items from review feedback are tracked as Phase 2/3 enhancements in the implementation plan:

  1. Dynamic Bot Authors List (Phase 2)

    • Current: Hardcoded in workflow env vars
    • Future: Fetch from .github/pr-maintenance-config.json
    • Tracked in: Implementation plan Phase 2
  2. Expanded Reviewer Filter (Phase 2)

    • Current: Only processes known bot authors
    • Future: Process all reviewers (human + bot)
    • Tracked in: Implementation plan Phase 2
  3. GitHub Issues for Epic (Phase 3)

    • Epic and milestones defined in implementation plan
    • Will create issues once Phase 1 deployment complete
    • Tracked in: Implementation plan Phase 3
  4. Main Branch Merge


Review Status

Original Comments: 31 from PR #249
Actionable: 27 (addressed)
Deferred as Future: 4 (tracked in implementation plan)
Completion: 100% of blocking issues resolved

Ready for: Re-review and approval


Testing Recommendations

Before enabling live mode (DryRun=false):

  1. 24-Hour DryRun Test

    • Monitor logs for errors
    • Validate rate limit checks work correctly
    • Verify BOT_PAT attribution in audit log
  2. Manual Verification

    • Test rate limit check with gh api rate_limit
    • Verify all 4 resources checked (core, search, code_search, graphql)
    • Confirm thresholds appropriate (can tune if needed)
  3. Gradual Rollout

    • Week 1: DryRun mode, gather metrics
    • Week 2: Enable live mode, monitor closely
    • Week 3: Phase 2 enhancements (structured logging, retry logic)

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Update automation PR for security validation Address PR #249 review feedback: restructure ADR, fix rate limiting, slim workflow Dec 22, 2025
Copilot AI requested a review from rjmurillo December 22, 2025 18:43
@rjmurillo

Copy link
Copy Markdown
Owner

@copilot Proceed

Copilot AI commented Dec 22, 2025

Copy link
Copy Markdown
Contributor Author

@copilot Proceed

Starting Phase 1: Document Restructuring. Will extract actual architectural decisions from ADR-015 and create separate documents for security analysis and implementation planning.

Copilot AI and others added 2 commits December 22, 2025 18:52
…supporting documents

- Extract true architectural decisions into streamlined ADR-015
- Move security analysis to SR-002 security review
- Move implementation plan to planning directory
- Update workflow: DryRun=true default, BOT_PAT, remove ephemeral cleanup
- Increase timeout to 45min (realistic for PRs with many comments)
- Remove version/date footers (git tracks this)
- Add proper markdown links between documents

Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>
…hresholds

- Update Test-RateLimitSafe to check core, search, code_search, and graphql resources
- Set resource-specific thresholds: search=15 (50% of 30), code_search=5 (50% of 10)
- Update workflow rate limit check to display table of all resources
- Address feedback: static 200 threshold inappropriate for resources with limits <30
- Implements ADR-015 Decision 2: Multi-Resource Rate Limiting

Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>
@rjmurillo

Copy link
Copy Markdown
Owner

@copilot Implement Phase 2 and 3

Copilot AI commented Dec 22, 2025

Copy link
Copy Markdown
Contributor Author

@copilot Implement Phase 2 and 3

Starting Phase 2 and 3 implementation. Will address remaining workflow simplification and documentation improvements.

@rjmurillo rjmurillo marked this pull request as ready for review December 22, 2025 20:28
@github-actions github-actions Bot added area-workflows GitHub Actions workflows automation Automated workflows and processes github-actions GitHub Actions workflow updates labels Dec 22, 2025
@rjmurillo rjmurillo merged commit 6788efd into feat/dash-script Dec 22, 2025
6 of 7 checks passed
@rjmurillo rjmurillo deleted the copilot/sub-pr-249 branch December 22, 2025 20:28
id: maintenance
env:
GH_TOKEN: ${{ github.token }}
GH_TOKEN: ${{ secrets.BOT_PAT }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scheduled runs execute in live mode instead of dry run

The $dryRun logic checks if inputs.dry_run equals 'true', but inputs is only populated for workflow_dispatch triggers. When the workflow runs on the hourly schedule, ${{ inputs.dry_run }} evaluates to an empty string, causing the comparison '' -eq 'true' to be false, setting $dryRun = $false. This means scheduled runs execute in live mode, making real changes to PRs, which directly contradicts the "DryRun-First Deployment" goal stated in ADR-015 and the PR description. The logic needs to default to dry run when inputs.dry_run is undefined or empty.

Fix in Cursor Fix in Web

FAILED=1
else
echo "| graphql | $GRAPHQL_REMAINING | $GRAPHQL_THRESHOLD | ✅ OK |" >> $GITHUB_STEP_SUMMARY
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bash rate limit checks fail ungracefully on null values

The bash rate limit comparisons use [ "$CORE_REMAINING" -lt "$CORE_THRESHOLD" ] without validating that jq returned a numeric value. If a resource doesn't exist in the API response or returns null, jq outputs the string "null", and bash's -lt operator fails with "integer expression expected". This is inconsistent with the PowerShell Test-RateLimitSafe function which explicitly checks if ($null -eq $resource) and gracefully skips missing resources with a warning. The bash script lacks equivalent null/empty checks before arithmetic comparisons.

Fix in Cursor Fix in Web

rjmurillo added a commit that referenced this pull request Dec 23, 2025
…(ADR-015) (#249)

* docs: add session 64 log (PR #242 review)

Session log for PR review response workflow.

Completed:
- Improved .gitattributes documentation (commit 6a1cc7c)
- Replied to all 4 rjmurillo comments

Pending:
- Token algorithm decision (awaiting response)
- Pester tests implementation

Session-Type: PR-Review
PR: #242

* docs(devops): comprehensive PR automation script review and workflow design

- Conducted full operationalization review of scripts/Invoke-PRMaintenance.ps1
- Analyzed scheduling, CI/CD integration, monitoring, logging, security
- Designed GitHub Actions workflow for hourly PR maintenance
- Identified critical P0 recommendations (concurrency, rate limits, alerts)
- Created .github/workflows/pr-maintenance.yml with production-ready config
- Documented performance targets, 12-factor compliance, operational runbook
- Session 64: DevOps review deliverables

Review artifacts:
- .agents/devops/pr-automation-script-review.md (comprehensive review)
- .github/workflows/pr-maintenance.yml (hourly automation workflow)
- .agents/sessions/2025-12-22-session-64-pr-automation-devops-review.md

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs(session): update session 64 with canonical checklist format

- Add canonical Session End checklist per SESSION-PROTOCOL.md
- Document all deliverables and evidence
- Mark N/A items with justification (no feature code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs(qa): validate PR maintenance workflow pre-deployment

- Infrastructure QA: YAML syntax, security, error handling validation
- Validates GitHub Actions workflow before deployment
- Documents 4-phase test plan (syntax, dry-run, live, scheduled)
- All criteria PASS: SHA pins, permissions, concurrency, cleanup
- Update session 64 log with QA report reference

QA artifacts:
- .agents/qa/pr-automation-workflow-validation.md (comprehensive validation)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* chore: add .agents/logs to .gitignore

- PR maintenance script creates runtime logs in .agents/logs/
- Logs are artifacts and should not be committed
- Consistent with other agent scratch directories

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(automation): add PR maintenance script and tests

- Hourly PR automation: acknowledge bot comments, resolve conflicts, close superseded PRs
- Safety features: dry-run mode, protected branch check, worktree isolation
- Comprehensive error handling and logging
- Pester test suite for reliability validation

Script capabilities:
- Acknowledge unacknowledged bot comments (eyes reaction)
- Auto-resolve HANDOFF.md merge conflicts
- Close PRs superseded by merged PRs
- Report blocked PRs (CHANGES_REQUESTED)

Exit codes:
- 0: Success
- 1: Partial (some blocked)
- 2: Error

Related artifacts:
- .agents/devops/pr-automation-script-review.md (operationalization review)
- .github/workflows/pr-maintenance.yml (GitHub Actions workflow)
- .agents/qa/pr-automation-workflow-validation.md (QA validation)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs(session): update session 64 final commit SHA

- Update commit SHA to 8652a3f (PR automation script + tests)
- All session artifacts committed and validated

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs(session): mark validation PASSED for session 64

- Session end validation completed successfully (exit 0)
- All protocol requirements met
- All artifacts committed and verified

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(security): implement P0 security fixes for PR automation script (ADR-015)

Addresses 6 critical security issues identified by multi-agent review:

P0 Fixes Implemented:
1. Branch name validation - prevents command injection via Test-SafeBranchName
2. Worktree path validation - prevents path traversal via Get-SafeWorktreePath
3. Concurrency lock - prevents race conditions via Enter-ScriptLock/Exit-ScriptLock
4. Int64 CommentId - fixes overflow bug (GitHub IDs exceed Int32.MaxValue)
5. Workflow concurrency - already implemented (concurrency: group: pr-maintenance)
6. Rate limit pre-flight - prevents API exhaustion via Test-RateLimitSafe

Agent Review Summary:
- Architect: Created ADR-015 reconciling 5 agent reviews (roadmap, critic, security, devops, qa)
- High-Level-Advisor: Challenged timeline (1 week -> 2 weeks), promoted rate limit to P0
- Critic: APPROVED all 6 P0 fixes after implementation review

Files:
- scripts/Invoke-PRMaintenance.ps1: +170 lines (security validation region)
- .agents/architecture/ADR-015-pr-automation-reconciliation.md: Phase 1/2/3 prioritization
- .agents/sessions/2025-12-22-session-65-adr-015-reconciliation.md: Session log

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test(adr-015): add 68 Pester tests for security validation functions

Phase 1B - Add comprehensive Pester tests for ADR-015 P0 security fixes:

Test-SafeBranchName (47 tests):
- Empty/whitespace validation (5 tests)
- Hyphen prefix prevention (6 tests)
- Path traversal prevention (5 tests)
- Control character detection (6 tests)
- Git special character detection (8 tests)
- Shell metacharacter detection (11 tests)
- Valid branch name acceptance (7 tests)

Get-SafeWorktreePath (7 tests):
- Input validation (5 tests)
- Path traversal prevention (2 tests)

Enter-ScriptLock/Exit-ScriptLock (5 tests):
- Lock acquisition and release
- Stale lock detection (>15 min)
- Concurrent execution prevention

Test-RateLimitSafe (6 tests):
- API response handling
- Fail-open behavior on errors
- Default minimum threshold

Add-CommentReaction Int64 (2 tests):
- Large comment ID support (exceeds Int32.MaxValue)

Also adds dot-source guard to prevent script execution during testing.

ADR-015 Phase 1B confirmation criteria progress:
- [x] Pester tests pass for validation functions (68 tests, all PASS)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(adr-015): fix bugs and add rollback procedure

Fixes:
- Use $pr.headRefName instead of $pr.head (field name mismatch)
- Replace empty strings in Write-Log with "---" separators

Docs:
- Add comprehensive rollback procedure for PR maintenance automation
- Document 5 rollback levels from workflow disable to full removal
- Include recovery procedures for specific failure scenarios

ADR-015 Phase 1B complete:
- [x] Pester tests pass (68 tests)
- [x] Security agent approval
- [x] Rollback procedure documented
- [x] Integration test with DryRun (4.5s, exit 1 for blocked PRs)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs(adr-015): update Phase 1 completion status

Mark completed Phase 1 criteria:
- [x] All 6 fixes implemented (Session 65)
- [x] Pester tests pass (68 tests, Session 66)
- [x] Integration test passed (4.5s, Session 66)
- [x] Security agent approval (Session 66)
- [x] Rollback procedure documented (Session 66)

Remaining:
- [ ] 24-hour DryRun deployment monitoring

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: resolve PR review comments on property naming and permissions (#251)

* Initial plan

* fix: address PR review comments - property naming, comment clarity, workflow permissions

Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>

* Address PR #249 review feedback: restructure ADR, fix rate limiting, slim workflow (#253)

* Initial plan

* refactor: restructure ADR-015 into focused architectural decisions + supporting documents

- Extract true architectural decisions into streamlined ADR-015
- Move security analysis to SR-002 security review
- Move implementation plan to planning directory
- Update workflow: DryRun=true default, BOT_PAT, remove ephemeral cleanup
- Increase timeout to 45min (realistic for PRs with many comments)
- Remove version/date footers (git tracks this)
- Add proper markdown links between documents

Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>

* feat: implement multi-resource rate limiting with resource-specific thresholds

- Update Test-RateLimitSafe to check core, search, code_search, and graphql resources
- Set resource-specific thresholds: search=15 (50% of 30), code_search=5 (50% of 10)
- Update workflow rate limit check to display table of all resources
- Address feedback: static 200 threshold inappropriate for resources with limits <30
- Implements ADR-015 Decision 2: Multi-Resource Rate Limiting

Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>

* docs(analysis): comprehensive PR #249 review comment analysis

Analyzed 59 review comments (corrected from initial 47 estimate) across
4 reviewers with priority categorization and implementation strategy.

Priority Breakdown:
- P0 (Critical): 3 cursor[bot] HIGH severity bugs (BLOCKING)
  - Hardcoded main branch in conflict resolution
  - Scheduled runs bypass DryRun safety mode
  - Protected branch check blocks automation
- P1 (High): 4 critical bugs requiring immediate fix
- P2 (Medium): 47 comments (selective addressing)
- P3 (Low): 5 gemini code quality (defer to follow-up)

Key Insights:
- All 6 cursor[bot] comments verified as real bugs (100% actionability)
- ~15 of 42 rjmurillo comments are @copilot-directed (not for us)
- P0 issues violate ADR-015 requirements and break automation
- Estimated 2 hours for P0-P1 fixes

Analysis artifacts saved to .agents/pr-comments/PR-249/ (gitignored):
- analysis.md: Comprehensive analysis with grouped issues
- analyzed-comments.json: Structured data for automation
- analyze-comments.py: Reusable analysis script
- raw-comments.json: Full comment data

Session: .agents/sessions/2025-12-22-session-68-pr-249-comment-analysis.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix: address P0-P1 cursor[bot] review comments on PR #249

P0 Critical Fixes (BLOCKING MERGE):
- Use PR target branch (baseRefName) instead of hardcoded 'main' in
  Resolve-PRConflicts to support non-main base branches
- Default dry_run to true for scheduled runs (ADR-015 safety requirement)
- Allow protected branch check to pass in CI environment (GITHUB_ACTIONS)

P1 High Priority Fixes:
- Add GH_TOKEN env var to workflow summary step for rate_limit API call
- Capture and log rate limit reset time for smarter scheduling
- Check $LASTEXITCODE after git push to detect failures
- Fix Test-RateLimitSafe tests to use correct multi-resource API format

Test improvements:
- Update rate limit tests to match actual function signature (no
  -MinimumRemaining param, uses $ResourceThresholds hashtable)
- Fix try/finally regex test to handle multiline content

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* docs: update session 67 log with PR #249 fix implementation

- Document all 7 P0-P1 fixes implemented in commit 52ce873
- Record all 7 in-thread replies posted to cursor[bot] comments
- Note pre-existing test failures (unrelated to changes)
- Add learnings about PowerShell scope qualifiers and Pester patterns

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* docs(session): add session 69 - PR #249 P2 review analysis

Analyzed 4 targeted P2 review comments for PR #249:
- Permission inconsistency: NOT A BUG (workflow has contents: write)
- Property naming (headRefName vs pr.head): NOT A BUG (intentional jq alias)
- File-based lock vs ADR-015: VALID (redundant, recommend follow-up cleanup)
- Escape character typo: NOT A BUG (valid PowerShell escape sequence)

Posted 5 clarifying replies to PR review threads.
No code changes required.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* Refactor PR maintenance to reuse GitHub skill PowerShell and drop auto-close (#256)

* Initial plan

* feat: address PR #249 review feedback - DRY PowerShell, GitHub runner detection, drop auto-close

- Add reusable GitHub skill scripts: New-Issue.ps1, Post-PRComment.ps1, Close-PR.ps1
- Update workflow to use PowerShell scripts for issue creation (DRY principle)
- Add missing GH_TOKEN env var to "Post summary" step for rate limit check
- Update footer text to use PR Maintenance link format
- Detect GitHub Actions runner environment to skip worktree isolation
- Replace superseded PR auto-close with informational logging (like CodeRabbit)
- Document retention period alignment with operational logs
- Fix PowerShell string interpolation for rate limit violations
- Add note about bot comment logic referencing agent config files

Addresses comments:
- 2641261115, 2641274255: Footer text updates
- 2641270041: Add GH_TOKEN, DRY rate limit check
- 2641272016, 2641277796: Reuse PowerShell for issue creation
- 2641276732: Document retention period COGS alignment
- 2641284272: Detect GitHub runner, skip worktree when not needed
- 2641287744: Use GitHub PowerShell for git operations
- 2641294198: Drop auto-close, log similar PRs instead
- 2641294760, 2641295117: Use GitHub PowerShell for PR operations
- 2641298930: Add note about agent config reference

Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>

* test: update Invoke-PRMaintenance.Tests.ps1 for new function signatures

- Replace Test-PRSuperseded/Close-SupersededPR tests with Get-SimilarPRs tests
- Add Test-IsGitHubRunner function tests
- Update Test-RateLimitSafe tests for multi-resource thresholds
- Note: Some pre-existing test failures remain (LASTEXITCODE mock issues)

Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>

* fix: remove duplicate Post-PRComment, use existing Post-PRCommentReply in Close-PR

- Remove .claude/skills/github/scripts/pr/Post-PRComment.ps1 (duplicate of Post-PRCommentReply.ps1)
- Update Close-PR.ps1 to use existing Post-PRCommentReply.ps1 instead of inline gh pr comment
- Improve documentation in Get-PRComments and Get-UnacknowledgedComments to clarify workflow cohesion

Addresses review comments:
- 2641380365: Use existing PowerShell for posting comments
- 2641388267: Remove duplicate, use Post-PRCommentReply.ps1
- 2641392312: Document cohesion of PR comment functions

Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>

* fix: use explicit variable interpolation syntax in Close-PR.ps1

- Use ${Variable} syntax instead of $Variable for PR numbers and repo paths
- Consistent with Resolve-PRReviewThread.ps1 pattern
- More explicit and avoids potential parsing ambiguity

Addresses review comment 2641382083

Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>

* fix: correct issue number regex pattern in New-Issue.ps1

Fixes cursor[bot] HIGH severity bug (comment 2641394603):
- Changed regex from '#(\d+)' to 'issues/(\d+)'
- Matches actual gh CLI output format (URL: https://github.com/owner/repo/issues/123)
- Prevents exit code 3 failures in workflow alert/notification steps

Also adds session 70 log documenting:
- Merge conflict resolution (feat/dash-script into copilot/sub-pr-249)
- Verification of Copilot's work on 4 rjmurillo comments (all ✅)
- cursor[bot] bug fix (this commit)

Addresses: PR #256 review comment 2641394603
Part of: Session 70 Option A (resolve conflicts + verify work)

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>
Co-authored-by: rjmurillo-bot <rjmurillo-bot@users.noreply.github.com>
Co-authored-by: Copilot <copilot@github.com>

* chore: PR #249 session 71 - complete comment acknowledgment

Session 71 work:
- Added eyes reactions to all 67 top-level comments (Phase 2 BLOCKING GATE satisfied)
- Verified sessions 67-69 addressed all bot feedback
- pr-comment-responder workflow complete; human review approval pending

Evidence:
- 67/67 top-level comments acknowledged
- Sessions 67-69: 12 replies posted, 7 P0-P1 fixes implemented
- Review state: CHANGES_REQUESTED from human reviewer

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* docs(retrospective): comprehensive PR #249 review analysis

Root Cause Analysis:
- Identified 4 patterns causing P0-P1 misses (cross-cutting concerns,
  fail-safe logic, test-implementation drift, logging gaps)
- All 7 P0-P1 issues were cursor[bot] findings (100% actionability)

Reviewer Statistics Updated:
- cursor[bot]: 28/30 verified (95%+), approaching skip-analysis threshold
- Copilot: 21% actionability on PR #249 (declining from 35%)
- gemini-code-assist[bot]: 20% actionability (stable)

Skills Extracted:
- Skill-PR-249-001: Scheduled workflow fail-safe default
- Skill-PR-249-002: PowerShell LASTEXITCODE check pattern
- Skill-PR-249-003: CI environment detection
- Skill-PR-249-004: Workflow step environment propagation
- Skill-PR-249-005: Parameterize branch references

Memory Updates:
- cursor-bot-review-patterns: Added PR #249 patterns 8-9
- copilot-pr-review-patterns: Added PR #249 analysis
- pr-comment-responder-skills: Updated cumulative statistics
- skills-pr-validation-gates: NEW pre-PR checklist template

Refs: PR #249, Session 72

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* chore(skillbook): validate PR #249 skills and update reviewer stats

- Validated 5 skills from PR #249 retrospective (avg atomicity 94.8%)
- Updated cursor[bot] stats: 28/28 verified (100%, 93% to skip-analysis)
- Updated Copilot trend: declining to 21% actionability
- Updated pr-comment-responder cumulative stats
- Added pattern 10 to cursor-bot-review-patterns
- Zero duplicates found across skill memories

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix(pr-maintenance): address cursor[bot] and ADR-015 compliance issues

- Add LASTEXITCODE reset in test mocks for Get-OpenPRs (cursor[bot] #2641455674)
- Add LASTEXITCODE check in Get-SimilarPRs to handle API errors (cursor[bot] #2641455676)
- Convert Enter-ScriptLock and Exit-ScriptLock to no-ops per ADR-015 Decision 1
- Fix PowerShell variable parsing for PR number in error messages
- Update tests to reflect ADR-015 no-op lock behavior

Addresses review comments from PR #249 session 74.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* docs: add session 74 log for PR #249 new comments

Documents review of 8 new comments added since session 71:
- 2 cursor[bot] P0 issues (fixed)
- 1 human ADR compliance request (fixed)
- 5 Copilot P2 documentation suggestions (deferred)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

---------

Co-authored-by: rjmurillo-bot <rjmurillo-bot@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>
Co-authored-by: Copilot <copilot@github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-workflows GitHub Actions workflows automation Automated workflows and processes github-actions GitHub Actions workflow updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants