Skip to content

t1085.3: AI supervisor action executor with validated action types#1612

Merged
marcusquinn merged 4 commits intomainfrom
feature/t1085.3
Feb 18, 2026
Merged

t1085.3: AI supervisor action executor with validated action types#1612
marcusquinn merged 4 commits intomainfrom
feature/t1085.3

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Feb 18, 2026

Summary

  • Implements supervisor/ai-actions.sh — the action executor for the AI supervisor reasoning engine (t1085.2 output → t1085.3 execution)
  • Adds 7 validated action types: comment_on_issue, create_task, create_subtasks, flag_for_review, adjust_priority, close_verified, request_info
  • Each action is validated (type check + field validation) before execution, with dry-run and validate-only modes
  • Wires module into supervisor-helper.sh with ai-actions and ai-pipeline CLI commands
  • Includes 12 unit tests covering validation, execution modes, safety limits, and integration

Action Types

Action Description Safety Level
comment_on_issue Post comment on GitHub issue Low risk — additive
create_task Add task to TODO.md via claim-task-id.sh Low risk — additive
create_subtasks Break down existing task into subtasks Low risk — additive
flag_for_review Label issue + comment for human review Low risk — additive
adjust_priority Log priority recommendation (non-destructive) Minimal risk — advisory only
close_verified Close issue with verified merged PR proof High safety — requires merged PR + file changes
request_info Post structured info request on issue Low risk — additive

Safety Features

  • Action type allowlist (rejects unknown types)
  • Per-action field validation with specific rules per type
  • close_verified requires proof of merged PR with actual file changes
  • Configurable max actions per cycle (default: 10)
  • Dry-run and validate-only modes for testing
  • AI supervisor attribution footer on all GitHub comments
  • Full audit logging to ~/.aidevops/logs/ai-supervisor/

Ref #1602

Implements supervisor/ai-actions.sh with 7 validated action types:
- comment_on_issue: post comments on GitHub issues
- create_task: add new tasks to TODO.md via claim-task-id.sh
- create_subtasks: break down existing tasks into subtasks
- flag_for_review: label issues for human review
- adjust_priority: recommend priority changes (non-destructive)
- close_verified: close issues only with verified merged PR proof
- request_info: post structured info requests on issues

Each action is validated before execution (type check + field validation).
Includes dry-run and validate-only modes, safety limits, and audit logging.
- Source ai-actions.sh in module loading section
- Add ai-actions CLI command for direct action plan execution
- Add ai-pipeline CLI command for full reasoning+execution pipeline
- Enhance ai-status to show action execution count and max actions config
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 18, 2026

Warning

Rate limit exceeded

@marcusquinn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 8 minutes and 4 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/t1085.3

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.

@github-actions
Copy link

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 18 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Wed Feb 18 01:39:00 UTC 2026: Code review monitoring started
Wed Feb 18 01:39:00 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 18

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 18
  • VULNERABILITIES: 0

Generated on: Wed Feb 18 01:39:03 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

12 tests covering:
- Syntax check and module sourcing
- Action type validation (7 valid, 4 invalid)
- Field validation (20 cases across all action types)
- Empty plan handling, invalid JSON rejection
- Validate-only and dry-run modes
- Safety limit enforcement (max actions per cycle)
- Invalid action type skipping with correct reason
- CLI help flag
- Integration with supervisor-helper.sh sourcing
@marcusquinn marcusquinn marked this pull request as ready for review February 18, 2026 01:43
@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 extends the AI supervisor's capabilities by introducing a robust and validated action execution framework. It allows the AI to perform a variety of structured operations based on its reasoning, such as interacting with GitHub issues and managing tasks, all while incorporating critical safety checks to prevent unintended changes. This enhancement moves the AI supervisor closer to autonomous operation by enabling it to act on its insights in a controlled manner.

Highlights

  • New AI Action Executor: Introduced a dedicated AI supervisor action executor script (ai-actions.sh) responsible for processing and executing AI-generated action plans.
  • Validated Action Types: Implemented strict validation for AI action types and their required fields, ensuring only predefined and correctly structured actions can be executed, enhancing system safety and reliability.
  • Supported AI Actions: Added support for a range of specific AI actions, including commenting on GitHub issues, creating new tasks and subtasks in TODO.md, flagging issues for human review, recommending priority adjustments, closing verified issues, and requesting additional information.
  • Supervisor Integration: Integrated the new action execution capabilities into supervisor-helper.sh by sourcing ai-actions.sh, adding ai-actions and ai-pipeline commands, and enhancing ai-status to report on action execution metrics.
  • Comprehensive Testing: Included a new unit test suite (test-ai-actions.sh) to cover the validation logic, field checks, and various execution modes (dry-run, validate-only) of the AI action executor.
Changelog
  • .agents/scripts/supervisor-helper.sh
    • Sourced the new ai-actions.sh module to enable AI action execution.
    • Added new ai-actions command to execute action plans with options for mode (execute, dry-run, validate-only) and plan input.
    • Introduced ai-pipeline command to run the full AI reasoning and action execution flow.
    • Updated ai-status command to include total action executions and the maximum actions allowed per cycle.
  • .agents/scripts/supervisor/ai-actions.sh
    • Added new script to handle execution of AI-generated action plans.
    • Implemented execute_action_plan function to process a JSON array of actions, including logging and safety limits.
    • Defined validate_action_type to ensure actions are from a predefined safe list.
    • Created validate_action_fields to enforce required fields for each action type.
    • Developed execute_single_action and helper functions for specific actions: comment_on_issue, create_task, create_subtasks, flag_for_review, adjust_priority, close_verified, and request_info.
    • Included run_ai_actions_pipeline to orchestrate reasoning and action execution.
    • Provided a CLI entry point for standalone testing and usage.
  • tests/test-ai-actions.sh
    • Added a new comprehensive unit test script for ai-actions.sh.
    • Included tests for script syntax, successful sourcing, and function existence.
    • Verified validate_action_type for both valid and invalid action types.
    • Tested validate_action_fields for all supported action types, checking for missing or invalid parameters.
    • Validated execute_action_plan behavior with empty plans, invalid JSON, validate-only mode, dry-run mode, and safety limit enforcement.
    • Confirmed correct skipping and error reporting for invalid action types.
Activity
  • The pull request is marked as Work In Progress (WIP) and includes incremental commits.
  • It references issue t1085.3: Action executor #1602, indicating it addresses a specific task or feature.
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.

@github-actions
Copy link

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 18 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Wed Feb 18 01:44:02 UTC 2026: Code review monitoring started
Wed Feb 18 01:44:03 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 18

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 18
  • VULNERABILITIES: 0

Generated on: Wed Feb 18 01:44:05 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

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 a robust AI action executor, ai-actions.sh, and integrates it into the supervisor workflow. The implementation is well-structured with clear separation of concerns for validation and execution of different action types. The accompanying test suite is comprehensive and covers various scenarios, which is excellent.

My review focuses on adherence to the repository's shell scripting style guide and improving the robustness of a few areas. I've identified a couple of style guide violations, such as the local variable assignment pattern and missing trap for a temporary file. I've also suggested improvements to argument parsing and a fix for how new tasks are appended to TODO.md to prevent issues with file parsing. Additionally, I've noted an opportunity to extract duplicated validation logic into a helper function, aligning with repository guidelines for maintainability. I've referenced the repository style guide for feedback on variable assignments (line 11), temporary file cleanup (line 33), and stderr redirection (line 50). Overall, this is a solid contribution that significantly enhances the supervisor's capabilities.


# Append to TODO.md (before the first blank line after the last task)
# Find the "Backlog" or last task section and append there
printf '\n%s\n' "$task_line" >>"$todo_file"

Choose a reason for hiding this comment

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

high

The _exec_create_task function appends new tasks to the end of TODO.md. However, the TODO.md file has structured TOON blocks at the end. Appending tasks after these blocks is incorrect and will likely break tools that parse the file. The new task should be inserted into the 'Backlog' section, before the TOON blocks.

Suggested change
printf '\n%s\n' "$task_line" >>"$todo_file"
# Find the line number of the first TOON block to insert before it.
local toon_line
toon_line=$(grep -n "<!--TOON:" "$todo_file" | head -1 | cut -d: -f1)
if [[ -n "$toon_line" ]]; then
local temp_file; temp_file=$(mktemp)
# shellcheck disable=SC2064
trap "rm -f '$temp_file'" RETURN
head -n "$((toon_line - 1))" "$todo_file" > "$temp_file"
printf '%s\n' "$task_line" >> "$temp_file"
tail -n "+$toon_line" "$todo_file" >> "$temp_file"
mv "$temp_file" "$todo_file"
else
# Fallback to appending
printf '\n%s\n' "$task_line" >>"$todo_file"
fi

Comment on lines +699 to +719
while [[ $# -gt 0 ]]; do
case "$1" in
--mode)
_aa_mode="$2"
shift 2
;;
--plan)
_aa_plan="$2"
shift 2
;;
--dry-run)
_aa_mode="dry-run"
shift
;;
--repo)
_aa_repo="$2"
shift 2
;;
*) shift ;;
esac
done

Choose a reason for hiding this comment

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

medium

The argument parsing loop for the ai-actions command uses shift 2 for options that take a value. This is fragile and will fail with an error if an option is passed without its value or as the last argument (e.g., ... --mode). It's safer to check for the presence of $2 before shifting and to handle the missing argument case gracefully.

                while [[ $# -gt 0 ]]; do
                        case "$1" in
                        --mode)
                                if [[ -z "$2" || "$2" == --* ]]; then
                                        log_error "ai-actions: --mode requires an argument"
                                        return 1
                                fi
                                _aa_mode="$2"
                                shift 2
                                ;;
                        --plan)
                                if [[ -z "$2" || "$2" == --* ]]; then
                                        log_error "ai-actions: --plan requires an argument"
                                        return 1
                                fi
                                _aa_plan="$2"
                                shift 2
                                ;;
                        --dry-run)
                                _aa_mode="dry-run"
                                shift
                                ;;
                        --repo)
                                if [[ -z "$2" || "$2" == --* ]]; then
                                        log_error "ai-actions: --repo requires an argument"
                                        return 1
                                fi
                                _aa_repo="$2"
                                shift 2
                                ;;
                        *) shift ;;
                        esac
                done

Comment on lines +42 to +44
local action_plan="$1"
local repo_path="${2:-$REPO_PATH}"
local mode="${3:-execute}"

Choose a reason for hiding this comment

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

medium

The repository style guide requires declaring local variables and assigning them on separate lines to ensure exit code safety. This pattern is not followed here and in most other functions in this file.

Suggested change
local action_plan="$1"
local repo_path="${2:-$REPO_PATH}"
local mode="${3:-execute}"
local action_plan; action_plan="$1"
local repo_path; repo_path="${2:-$REPO_PATH}"
local mode; mode="${3:-execute}"
References
  1. Use local var; var="$1" pattern in functions (declare and assign separately for exit code safety). (link)

Comment on lines +269 to +272
if ! [[ "$issue_number" =~ ^[0-9]+$ ]] || [[ "$issue_number" -eq 0 ]]; then
echo "issue_number must be a positive integer, got: $issue_number"
return 0
fi

Choose a reason for hiding this comment

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

medium

The validation logic for issue_number is duplicated in comment_on_issue, flag_for_review, close_verified, and request_info. This duplicated code could be extracted into a helper function to improve maintainability and reduce redundancy.

References
  1. In shell scripts, extract repeated logic into an internal helper function to improve maintainability.


# Insert subtask lines after the insertion point
local temp_file
temp_file=$(mktemp)

Choose a reason for hiding this comment

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

medium

This temporary file should have a trap for cleanup to prevent leaving orphaned files in /tmp on script exit or error. This is required by the repository style guide.

Suggested change
temp_file=$(mktemp)
temp_file=$(mktemp)
trap 'rm -f "$temp_file"' RETURN
References
  1. Temp files must have trap cleanup (RETURN or EXIT). (link)


# Step 1: Run reasoning to get action plan
local action_plan
action_plan=$(run_ai_reasoning "$repo_path" "$mode" 2>/dev/null)

Choose a reason for hiding this comment

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

medium

Suppressing stderr with 2>/dev/null can hide important errors from the run_ai_reasoning function, making debugging difficult. The style guide only permits this when redirecting to a log file. It would be better to redirect stderr to the supervisor's log file.

Suggested change
action_plan=$(run_ai_reasoning "$repo_path" "$mode" 2>/dev/null)
action_plan=$(run_ai_reasoning "$repo_path" "$mode" 2>>"$SUPERVISOR_LOG")
References
  1. 2>/dev/null is acceptable ONLY when redirecting to log files, not blanket suppression. (link)

@marcusquinn marcusquinn merged commit f686cc5 into main Feb 18, 2026
19 checks passed
@marcusquinn marcusquinn deleted the feature/t1085.3 branch February 18, 2026 01:49
marcusquinn added a commit that referenced this pull request Feb 18, 2026
…lict markers

- t1093: AI-adaptive daily routine scheduling (blocked-by:t1085.5)
- Resolved conflict markers from concurrent runner TODO.md updates
- t1085.3 (PR #1612) and t1085.4 (PR #1616) both confirmed merged
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