Skip to content

t299: Add Phase 10b to auto-create TODO tasks from quality findings#1171

Closed
marcusquinn wants to merge 2 commits intomainfrom
feature/t299
Closed

t299: Add Phase 10b to auto-create TODO tasks from quality findings#1171
marcusquinn wants to merge 2 commits intomainfrom
feature/t299

Conversation

@marcusquinn
Copy link
Owner

Summary

Closes the self-improvement feedback loop by adding Phase 10b to the supervisor pulse cycle.

Changes

  • Phase 10b implementation: Added after Phase 10, before Phase 11 in supervisor-helper.sh
  • CodeRabbit task creation: Calls coderabbit-task-creator-helper.sh create to convert findings into TODO tasks
  • Quality-sweep task creation: Calls quality-sweep-helper.sh tasks to convert SonarCloud/Codacy findings into TODO tasks
  • 24h cooldown: Self-throttles using state file at ~/.aidevops/.agent-workspace/supervisor/last-task-creation.json
  • Auto-commit: Commits and pushes TODO.md if new tasks were added
  • Auto-dispatch tags: All created tasks include #auto-dispatch for autonomous pickup

Testing

  • Verify Phase 10b runs during pulse cycle
  • Verify cooldown mechanism works (24h interval)
  • Verify tasks are created from CodeRabbit findings
  • Verify tasks are created from quality-sweep findings
  • Verify TODO.md is committed and pushed when tasks are added
  • Verify cooldown state file is created and updated

Impact

Currently 5 CodeRabbit findings (2 critical, 2 high) and 19 SonarCloud findings are waiting. Phase 10b will automatically convert these into actionable TODO tasks every 24 hours.

Ref #1169

…t299)

- Adds Phase 10b after Phase 10 in supervisor pulse cycle
- Converts CodeRabbit findings via coderabbit-task-creator-helper.sh create
- Converts quality-sweep findings via quality-sweep-helper.sh tasks
- Self-throttles with 24h cooldown using state file
- Commits and pushes TODO.md if new tasks were added
- Closes self-improvement feedback loop for autonomous quality task creation
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 11, 2026

Warning

Rate limit exceeded

@marcusquinn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 19 minutes and 38 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/t299

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

…299)

- Replace quality-sweep-helper.sh tasks with finding-to-task-helper.sh create
- quality-sweep tasks only shows table suggestions, not TODO-compatible lines
- finding-to-task-helper.sh create outputs proper TODO task format
- Limit to 10 tasks per run with medium+ severity to avoid spam
@marcusquinn marcusquinn marked this pull request as ready for review February 11, 2026 23:51
@gemini-code-assist
Copy link

Summary of Changes

Hello @marcusquinn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the self-improvement feedback loop by automating the conversion of quality findings from tools like CodeRabbit, SonarCloud, and Codacy into actionable TODO tasks. By integrating this new phase into the supervisor's regular pulse, the system will proactively address identified issues, reducing manual overhead and ensuring continuous code quality improvement. The implementation includes a cooldown to manage task creation frequency and automatically updates the project's TODO list.

Highlights

  • New Phase 10b: Introduced Phase 10b into the supervisor pulse cycle, positioned after Phase 10 and before Phase 11, to automate the creation of TODO tasks from quality findings.
  • Automated Task Creation: Implemented logic to call coderabbit-task-creator-helper.sh create and finding-to-task-helper.sh create to convert CodeRabbit and quality-sweep (SonarCloud/Codacy) findings into actionable TODO tasks.
  • 24-hour Cooldown Mechanism: Added a self-throttling mechanism with a 24-hour cooldown, managed by a state file at ~/.aidevops/.agent-workspace/supervisor/last-task-creation.json, to prevent task spam.
  • Auto-Commit and Push: Configured the system to automatically commit and push updates to TODO.md if new tasks are added, ensuring the task list is always up-to-date in the repository.
  • Auto-Dispatch Tags: Ensured all newly created tasks include the #auto-dispatch tag, facilitating autonomous pickup and processing of these tasks.
Changelog
  • .agents/scripts/supervisor-helper.sh
    • Added a new 'Phase 10b' section to the cmd_pulse function to manage automated task creation.
    • Implemented a 24-hour cooldown mechanism using a state file to control the frequency of task generation.
    • Integrated calls to coderabbit-task-creator-helper.sh and finding-to-task-helper.sh to generate tasks from quality findings.
    • Added logic to append newly created tasks to TODO.md.
    • Included functionality to automatically commit and push TODO.md changes if tasks are created.
    • Updated the task creation state file with timestamp and task creation status after each run.
Activity
  • No human activity (comments, reviews) has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces Phase 10b to automatically create TODO tasks from quality findings, effectively closing the feedback loop. However, it introduces two high-severity security risks: unvalidated repository paths leading to arbitrary file writes, and untrusted findings from external tools creating a path for indirect command injection via auto-dispatch tags. Additionally, there's a critical issue with error handling in git operations that could cause data inconsistency, and two medium-severity suggestions for improving efficiency by avoiding redundant commands. Addressing these points will make this valuable new feature more robust, secure, and performant.

Comment on lines +10294 to +10299
(
cd "$pulse_repo" || exit 1
git add TODO.md 2>>"$SUPERVISOR_LOG" || true
git commit -m "chore: auto-create tasks from quality findings (t299)" 2>>"$SUPERVISOR_LOG" || true
git push 2>>"$SUPERVISOR_LOG" || true
)

Choose a reason for hiding this comment

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

critical

Using || true on these git commands, especially git push, is risky as it suppresses all errors. A git push failure, for instance, would leave the remote TODO.md outdated, but the script would update the cooldown timer, preventing a retry for 24 hours. This can lead to silent failures and data inconsistency. While the style guide (line 13) allows || true for commands that may fail, a push failure is a definite failure of the operation's goal and should not be ignored. It's better to handle git operations more carefully by checking for changes before committing and letting set -e handle critical failures like a failed push.

Suggested change
(
cd "$pulse_repo" || exit 1
git add TODO.md 2>>"$SUPERVISOR_LOG" || true
git commit -m "chore: auto-create tasks from quality findings (t299)" 2>>"$SUPERVISOR_LOG" || true
git push 2>>"$SUPERVISOR_LOG" || true
)
(
cd "$pulse_repo" || exit 1
git add TODO.md 2>>"$SUPERVISOR_LOG"
# Only commit if there are changes to avoid an error from an empty commit.
if git diff --staged --quiet; then
log_verbose " No new tasks to commit to TODO.md."
else
git commit -m "chore: auto-create tasks from quality findings (t299)" 2>>"$SUPERVISOR_LOG"
git push 2>>"$SUPERVISOR_LOG"
fi
)

Comment on lines +10265 to +10283
echo "$coderabbit_output" >> "$todo_file"
tasks_created=true
local task_count
task_count=$(echo "$coderabbit_output" | grep -c "^- \[ \]" || echo "0")
log_verbose " Created $task_count tasks from CodeRabbit findings"
fi
fi

# Create tasks from quality-sweep findings (SonarCloud, Codacy)
local finding_to_task="${SCRIPT_DIR}/finding-to-task-helper.sh"
if [[ -x "$finding_to_task" ]]; then
log_verbose " Converting quality-sweep findings to tasks..."
local sweep_output
sweep_output=$("$finding_to_task" create --min-severity medium --limit 10 2>>"$SUPERVISOR_LOG" || true)

if [[ -n "$sweep_output" ]] && echo "$sweep_output" | grep -q "^- \[ \]"; then
# Append tasks to TODO.md
echo "" >> "$todo_file"
echo "$sweep_output" >> "$todo_file"

Choose a reason for hiding this comment

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

security-high high

This section appends findings from external tools (like CodeRabbit) directly into the TODO.md file with the #auto-dispatch tag. This creates a task injection vulnerability, as malicious content in findings could lead to automatic execution of commands by the dispatcher agent. Additionally, the current implementation involves inefficient double grep calls on coderabbit_output to check for and count tasks, which can be optimized.

Comment on lines +10247 to +10252
pulse_repo=$(db "$SUPERVISOR_DB" "SELECT DISTINCT repo FROM tasks LIMIT 1;" 2>/dev/null || echo "")
if [[ -z "$pulse_repo" ]]; then
pulse_repo="$(pwd)"
fi

local todo_file="${pulse_repo}/TODO.md"

Choose a reason for hiding this comment

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

security-high high

The pulse_repo variable is retrieved directly from the database and used to construct the todo_file path without any validation or sanitization. An attacker who can influence the tasks table in the database could potentially set repo to an arbitrary path (e.g., using path traversal or pointing to sensitive directories), leading to an arbitrary file write (append) when findings are written to TODO.md. Since this framework uses TODO.md for autonomous task execution, this could be used to inject malicious tasks into other repositories or locations.

Comment on lines +10280 to +10288
if [[ -n "$sweep_output" ]] && echo "$sweep_output" | grep -q "^- \[ \]"; then
# Append tasks to TODO.md
echo "" >> "$todo_file"
echo "$sweep_output" >> "$todo_file"
tasks_created=true
local task_count
task_count=$(echo "$sweep_output" | grep -c "^- \[ \]" || echo "0")
log_verbose " Created $task_count tasks from quality-sweep findings"
fi

Choose a reason for hiding this comment

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

medium

Similar to the CodeRabbit findings block, this block calls grep twice on sweep_output. It's more efficient to get the count once and use it for both the conditional check and the log message.

Suggested change
if [[ -n "$sweep_output" ]] && echo "$sweep_output" | grep -q "^- \[ \]"; then
# Append tasks to TODO.md
echo "" >> "$todo_file"
echo "$sweep_output" >> "$todo_file"
tasks_created=true
local task_count
task_count=$(echo "$sweep_output" | grep -c "^- \[ \]" || echo "0")
log_verbose " Created $task_count tasks from quality-sweep findings"
fi
local task_count
task_count=$(echo "$sweep_output" | grep -c "^- \[ \]" || echo "0")
if [[ "$task_count" -gt 0 ]]; then
# Append tasks to TODO.md
echo "" >> "$todo_file"
echo "$sweep_output" >> "$todo_file"
tasks_created=true
log_verbose " Created $task_count tasks from quality-sweep findings"
fi

@marcusquinn
Copy link
Owner Author

Closing: the improved Phase 10b implementation was already merged to main by a worker (with task ID assignment, simpler cooldown, and proper commit_and_push_todo pattern). This PR's original code was superseded. t299 is complete via the worker's version.

marcusquinn added a commit that referenced this pull request Feb 12, 2026
Add escalating conflict resolution to rebase_sibling_pr():
1. Plain rebase (no conflicts)
2. Rebase with -Xtheirs (feature branch wins on conflicts)
3. AI CLI resolution for complex cases (Strategy 3 fallback)

Also adds:
- resolve_rebase_conflicts() for AI-assisted per-file resolution
- Stale worktree cleanup (abort stuck rebases, fix detached HEAD)
- Temp worktree creation when no worktree exists (avoids dirty tree)
- CONFLICTING added to t298 handler (was only BEHIND/DIRTY)
- Phase 7b: periodic retry of merge-conflict-blocked tasks (30min)

Tested: resolved 4 blocked PRs (#1171, #1187, #1188, #1191) that
were stuck with merge conflicts — all resolved with -Xtheirs.
marcusquinn added a commit that referenced this pull request Feb 12, 2026
…1203)

Add escalating conflict resolution to rebase_sibling_pr():
1. Plain rebase (no conflicts)
2. Rebase with -Xtheirs (feature branch wins on conflicts)
3. AI CLI resolution for complex cases (Strategy 3 fallback)

Also adds:
- resolve_rebase_conflicts() for AI-assisted per-file resolution
- Stale worktree cleanup (abort stuck rebases, fix detached HEAD)
- Temp worktree creation when no worktree exists (avoids dirty tree)
- CONFLICTING added to t298 handler (was only BEHIND/DIRTY)
- Phase 7b: periodic retry of merge-conflict-blocked tasks (30min)

Tested: resolved 4 blocked PRs (#1171, #1187, #1188, #1191) that
were stuck with merge conflicts — all resolved with -Xtheirs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant