3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-08-04 05:03:30 +00:00

Optimize build-warning-fixer prebuild flow and issue-context patch handoff (#10347)

This updates the `build-warning-fixer` agentic workflow to reduce
avoidable setup overhead and improve handoff quality when triggered from
GitHub issues. It also hardens repository targeting so the workflow
operates only against `Z3Prover/z3`, not other repos.

- **Scope and intent**
- Restricts agent behavior to `Z3Prover/z3` via explicit prompt
guardrails.
- Clarifies issue-context output requirements so Copilot gets a complete
patch context for PR generation.

- **Prebuild efficiency**
- Replaces unconditional `apt-get update/install` with tool presence
checks.
- Installs build dependencies only when one or more required tools are
missing (`clang`, `clang-tidy`, `cmake`, `ninja`, `python3`).

- **Issue-context diff payload**
  - Expands required patch reporting for issue-dispatched runs:
    - `git status --short`
    - `git diff --stat`
    - `git diff`
- Requires explicit changed-file summary plus full unified diff block
when edits exist.

- **Lockfile synchronization**
- Regenerates `build-warning-fixer.lock.yml` from the updated workflow
source so runtime behavior matches prompt/step updates.

```bash
missing_tools=0
command -v clang >/dev/null 2>&1 || missing_tools=1
command -v clang-tidy >/dev/null 2>&1 || missing_tools=1
command -v cmake >/dev/null 2>&1 || missing_tools=1
command -v ninja >/dev/null 2>&1 || missing_tools=1
command -v python3 >/dev/null 2>&1 || missing_tools=1
if [ "$missing_tools" -eq 1 ]; then
  sudo apt-get update -y
  sudo apt-get install -y clang clang-tidy cmake ninja-build python3
fi
```

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
This commit is contained in:
Copilot 2026-08-01 10:56:54 -07:00 committed by GitHub
parent 47ec61793c
commit d86b591368
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 26 additions and 6 deletions

View file

@ -43,8 +43,16 @@ steps:
set -o pipefail
mkdir -p /tmp/gh-aw/agent
sudo apt-get update -y
sudo apt-get install -y clang clang-tidy cmake ninja-build python3
missing_tools=0
command -v clang >/dev/null 2>&1 || missing_tools=1
command -v clang-tidy >/dev/null 2>&1 || missing_tools=1
command -v cmake >/dev/null 2>&1 || missing_tools=1
command -v ninja >/dev/null 2>&1 || missing_tools=1
command -v python3 >/dev/null 2>&1 || missing_tools=1
if [ "$missing_tools" -eq 1 ]; then
sudo apt-get update -y
sudo apt-get install -y clang clang-tidy cmake ninja-build python3
fi
rm -rf build
@ -90,6 +98,12 @@ You are an AI agent that uses pre-collected clang-tidy diagnostics, reviews warn
## Your Task
### 0. Verify repository target
This workflow is only for `Z3Prover/z3`.
If `${{ github.repository }}` is not `Z3Prover/z3`, call `noop` immediately with a short explanation.
### 1. Review prebuild results before taking action
This workflow already ran a prebuild with clang-tidy before agent mode. Start by inspecting:
@ -167,11 +181,12 @@ If the rebuilt logs still contain actionable warnings, you may fix another small
When this workflow is dispatched from a GitHub issue context (for example via `aw_context` with `item_type == "issue"`), always include patch details to make PR creation easy:
```bash
git status --short
git diff --stat
git diff
```
If changes were made, include the full unified diff in your final response in a fenced `diff` block.
If changes were made, include the full unified diff in your final response in a fenced `diff` block and summarize changed files explicitly.
### 7. Create the pull request