Skip to content

fix(ci): close verification gaps in code-simplifier agentic workflow#225

Merged
YousefHadder merged 5 commits intomainfrom
fix/agentic-workflow-gaps
Mar 7, 2026
Merged

fix(ci): close verification gaps in code-simplifier agentic workflow#225
YousefHadder merged 5 commits intomainfrom
fix/agentic-workflow-gaps

Conversation

@YousefHadder
Copy link
Copy Markdown
Owner

@YousefHadder YousefHadder commented Mar 7, 2026

Summary

PR #223 (generated by the code-simplifier agentic workflow) revealed 6 gaps in the automated workflow. This PR addresses all of them:

  • Add ci-bot.yml — new workflow that triggers CI (stylua, luacheck, plenary tests) on PRs created by agentic workflows. GitHub blocks pull_request triggers for PRs from github-actions[bot], so this uses workflow_run to detect new bot PRs and run checks against their branch.
  • Add tool installation instructions to the code-simplifier prompt (Phase 3.0). The agent runner lacks Neovim/plenary/luacheck/stylua, so it was skipping all validation. Now it has explicit install commands and must abort if tools are unavailable.
  • Add type annotation verification (Phase 2.3). The agent wrote boolean|nil for a string|nil field because it inferred the type from usage instead of reading types.lua. Now it must read type definition files before writing annotations.
  • Add post-refactor standards audit (Phase 3.4). The agent introduced 4-level nesting that violates project standards. Now it must verify nesting depth, function length, and immutability after changes.
  • Add human reviewer alongside copilot. Changed from [copilot] to [copilot, YousefHadder].
  • Add minimum impact threshold (Principle 5). Prevents low-value changes like renaming local variables in small scopes from being included in PRs.

Test plan

  • make check passes (170/170 tests, luacheck clean, stylua clean)
  • gh aw compile succeeds with 0 errors, 0 warnings
  • Verify ci-bot.yml triggers on next code-simplifier run
  • Verify code-simplifier installs tools and runs make check in next run
  • Verify human reviewer is assigned on next bot PR

🤖 Generated with Claude Code

Address 6 issues found in PR #223 generated by the code-simplifier:

1. Add ci-bot.yml to run CI on bot-created PRs (workflow_run trigger)
   - GitHub blocks pull_request triggers for PRs from github-actions[bot]
   - Runs stylua, luacheck, and plenary tests on the PR branch
   - Reports combined status back to the PR commit

2. Add tool installation instructions to code-simplifier prompt (Phase 3.0)
   - Neovim, plenary.nvim, luacheck, stylua install commands
   - Blocks PR creation if any tool fails to install

3. Add type annotation verification step (Phase 2.3, step 4)
   - Requires reading type definition files before writing annotations
   - Prevents inferring types from runtime behavior alone

4. Add post-refactor standards audit (Phase 3.4)
   - Checks nesting depth, function length, file size, immutability
   - Reverts changes that violate project coding standards

5. Add human reviewer alongside copilot
   - Changed reviewers from [copilot] to [copilot, YousefHadder]

6. Add minimum impact threshold (Principle 5)
   - Skips low-value changes like local variable renames in small scopes
   - Requires measurable improvement: DRY, complexity, or standard fix

Also adds network.allowed (github + lua ecosystems) for tool downloads.
Copilot AI review requested due to automatic review settings March 7, 2026 06:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Closes validation gaps in the agentic Code Simplifier workflow by tightening workflow configuration, improving agent validation instructions, and adding CI coverage for bot-created PRs (where pull_request triggers don’t run).

Changes:

  • Extend the code-simplifier agent prompt with tooling install steps, type-annotation verification, standards audit checks, and a minimum-impact threshold.
  • Update code-simplifier workflow configuration (network allowlist + reviewers) and regenerate the compiled lockfile.
  • Add ci-bot.yml to run Stylua, Luacheck, and tests for PRs created by agentic workflows via workflow_run.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
.github/workflows/code-simplifier.md Updates agentic workflow frontmatter and strengthens the agent prompt’s validation/quality gates.
.github/workflows/code-simplifier.lock.yml Regenerated compiled workflow reflecting the updated prompt + allowlist + reviewers.
.github/workflows/ci-bot.yml New workflow to run CI on bot PRs using workflow_run and report a consolidated commit status.

- Fix plenary install: set PLENARY_DIR default before testing directory
  existence to make the check idempotent
- Fix stylua install: use $HOME/.local/bin and .tar.gz instead of
  /usr/local/bin and .zip to avoid sudo and unzip dependencies
- Fix ci-bot PR detection: correlate PR to triggering workflow via
  title prefix map instead of a blind 2-hour window scan
- Recompile agentic workflows (gh-aw v0.53.6 → v0.54.0)
Copilot AI review requested due to automatic review settings March 7, 2026 06:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

- Remove checks:write and statuses:write from top-level permissions
  so test/lint jobs run with read-only access (report-status already
  has its own statuses:write block)
- Expand stylua check to lua/ spec/ plugin/ to match make format-check
@YousefHadder YousefHadder merged commit 376c3f2 into main Mar 7, 2026
15 checks passed
@YousefHadder YousefHadder deleted the fix/agentic-workflow-gaps branch March 7, 2026 06:56
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.

2 participants