From 845671758f0851b38cf00338310f74db5ca406da Mon Sep 17 00:00:00 2001 From: Dev Lead Agent Date: Mon, 18 May 2026 16:44:56 +0000 Subject: [PATCH 01/10] =?UTF-8?q?feat:=20Phase=200=20=E2=80=94=20install?= =?UTF-8?q?=20and=20initialize=20gh-aw=20in=20.github-private=20(closes=20?= =?UTF-8?q?#230)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add gh-aw-compile job to lint.yml that installs the gh-aw extension and runs `gh aw compile`; skips gracefully if no .github/workflows/*.md exist - Create .github/agents/agentic-workflows.agent.md dispatcher config referencing Claude (CLAUDE_CODE_OAUTH_TOKEN) as the execution engine - Create tests/aw/README.md with scenario spec format, staged smoke test instructions, compile-gate CI docs, and Definition of Done checklist - Create tests/aw/issue-triage/ and tests/aw/ci-failure-analyst/ placeholder directories for the first two planned workflows Co-Authored-By: Claude Sonnet 4.6 --- .github/agents/agentic-workflows.agent.md | 36 ++++++++++++ .github/workflows/lint.yml | 17 ++++++ tests/aw/README.md | 70 +++++++++++++++++++++++ tests/aw/ci-failure-analyst/.gitkeep | 0 tests/aw/issue-triage/.gitkeep | 0 5 files changed, 123 insertions(+) create mode 100644 .github/agents/agentic-workflows.agent.md create mode 100644 tests/aw/README.md create mode 100644 tests/aw/ci-failure-analyst/.gitkeep create mode 100644 tests/aw/issue-triage/.gitkeep diff --git a/.github/agents/agentic-workflows.agent.md b/.github/agents/agentic-workflows.agent.md new file mode 100644 index 000000000..5edfab8e0 --- /dev/null +++ b/.github/agents/agentic-workflows.agent.md @@ -0,0 +1,36 @@ +--- +name: agentic-workflows +description: > + Dispatcher for gh-aw agentic workflows in petry-projects/.github-private. + Routes GitHub events to the appropriate workflow definition and executes + them using Claude as the engine. +engine: claude +tools: ["read", "search", "execute"] +--- + +You are the agentic workflow dispatcher for `petry-projects/.github-private`. + +## Engine + +This dispatcher uses Claude via `CLAUDE_CODE_OAUTH_TOKEN` as the execution engine. + +## Workflows + +Dispatch to the appropriate workflow based on the GitHub event context: + +- `issue-triage` — triages newly opened issues, applies labels, and routes to the right team +- `ci-failure-analyst` — analyzes CI failures on PRs and posts a root-cause summary + +## Dispatch rules + +1. Read the incoming event payload from context +2. Match against available workflow definitions in `.github/workflows/*.md` +3. Execute the matched workflow with the event payload +4. Post results back to the triggering issue, PR, or workflow run + +## Constraints + +- Never modify `.github/workflows/agent-shield.yml` +- Follow org standards in `AGENTS.md` and `petry-projects/.github/AGENTS.md` +- Use `GITHUB_TOKEN` for GitHub API calls; use `CLAUDE_CODE_OAUTH_TOKEN` for Claude invocations +- Do not store or log secrets diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 947a90b89..8827f1a02 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -34,3 +34,20 @@ jobs: - name: Run tests run: bats tests/fleet_report.bats + + gh-aw-compile: + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Install gh-aw + run: curl -sL https://raw.githubusercontent.com/github/gh-aw/main/install-gh-aw.sh | bash + + - name: Compile agentic workflows + run: | + if ls .github/workflows/*.md > /dev/null 2>&1; then + gh aw compile + else + echo "No .github/workflows/*.md files found — skipping compile." + fi diff --git a/tests/aw/README.md b/tests/aw/README.md new file mode 100644 index 000000000..2ede80a99 --- /dev/null +++ b/tests/aw/README.md @@ -0,0 +1,70 @@ +# Agentic Workflow Tests + +This directory contains scenario specs and smoke tests for `gh-aw` agentic workflows. + +## Test methodology + +Tests follow a three-level approach: + +1. **Compile validation (CI gate)** — `gh aw compile` runs on every PR that touches `.github/workflows/*.md`. A compile failure blocks merge. No runtime required. + +2. **Staged smoke tests (pre-merge)** — Run a workflow against a fixture payload without posting real GitHub API side-effects. Use `--staged` to dry-run: + ``` + gh aw run --staged --payload tests/aw//fixtures/.json + ``` + Smoke tests assert that the workflow reaches the expected terminal state and produces the expected output structure. + +3. **Integration tests (manual / scheduled)** — Execute against a real GitHub event in a sandbox repo. Reserved for release-gate validation; not required on every PR. + +## Scenario spec format + +Write scenario specs **before** the workflow markdown. Each spec lives in `tests/aw//` as a plain markdown file: + +``` +tests/aw// + README.md ← scenario specs (this pattern) + fixtures/ ← JSON payloads matching GitHub webhook schemas + smoke.sh ← staged smoke test runner (optional) +``` + +A scenario spec block: + +```markdown +### Scenario: + +**Given** +**When** +**Then** + +**Fixture:** `fixtures/.json` +``` + +## Running compile validation locally + +```bash +curl -sL https://raw.githubusercontent.com/github/gh-aw/main/install-gh-aw.sh | bash +gh aw compile +``` + +The compile step validates all `*.md` files in `.github/workflows/` against the gh-aw schema. It does not invoke Claude or make API calls. + +## Running staged smoke tests + +```bash +# Run a single workflow against a fixture payload +gh aw run issue-triage --staged --payload tests/aw/issue-triage/fixtures/new-bug.json + +# Run all smoke tests for a workflow +bash tests/aw/issue-triage/smoke.sh +``` + +## Definition of Done checklist + +A workflow is ready to merge when: + +- [ ] Scenario specs written in `tests/aw//README.md` before implementation starts +- [ ] `gh aw compile` passes with no errors +- [ ] At least one fixture payload exists under `tests/aw//fixtures/` +- [ ] Staged smoke test passes: `gh aw run --staged` exits 0 +- [ ] CI lint job (`gh-aw-compile`) is green on the PR +- [ ] Workflow markdown reviewed by a second author or the pr-reviewer agent diff --git a/tests/aw/ci-failure-analyst/.gitkeep b/tests/aw/ci-failure-analyst/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/tests/aw/issue-triage/.gitkeep b/tests/aw/issue-triage/.gitkeep new file mode 100644 index 000000000..e69de29bb From b0707afc67bb531150f610d012c04293f7d88323 Mon Sep 17 00:00:00 2001 From: donpetry-bot Date: Tue, 19 May 2026 02:43:02 +0000 Subject: [PATCH 02/10] chore: apply manual instructions [skip ci-relay] --- .github/agents/agentic-workflows.agent.md | 36 ------------------- .github/workflows/lint.yml | 22 ++++++++---- agents/agentic-workflows.md | 44 +++++++++++++++++++++++ tests/aw/README.md | 10 +++--- 4 files changed, 65 insertions(+), 47 deletions(-) delete mode 100644 .github/agents/agentic-workflows.agent.md create mode 100644 agents/agentic-workflows.md diff --git a/.github/agents/agentic-workflows.agent.md b/.github/agents/agentic-workflows.agent.md deleted file mode 100644 index 5edfab8e0..000000000 --- a/.github/agents/agentic-workflows.agent.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -name: agentic-workflows -description: > - Dispatcher for gh-aw agentic workflows in petry-projects/.github-private. - Routes GitHub events to the appropriate workflow definition and executes - them using Claude as the engine. -engine: claude -tools: ["read", "search", "execute"] ---- - -You are the agentic workflow dispatcher for `petry-projects/.github-private`. - -## Engine - -This dispatcher uses Claude via `CLAUDE_CODE_OAUTH_TOKEN` as the execution engine. - -## Workflows - -Dispatch to the appropriate workflow based on the GitHub event context: - -- `issue-triage` — triages newly opened issues, applies labels, and routes to the right team -- `ci-failure-analyst` — analyzes CI failures on PRs and posts a root-cause summary - -## Dispatch rules - -1. Read the incoming event payload from context -2. Match against available workflow definitions in `.github/workflows/*.md` -3. Execute the matched workflow with the event payload -4. Post results back to the triggering issue, PR, or workflow run - -## Constraints - -- Never modify `.github/workflows/agent-shield.yml` -- Follow org standards in `AGENTS.md` and `petry-projects/.github/AGENTS.md` -- Use `GITHUB_TOKEN` for GitHub API calls; use `CLAUDE_CODE_OAUTH_TOKEN` for Claude invocations -- Do not store or log secrets diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 8827f1a02..1df9a8538 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -41,13 +41,23 @@ jobs: steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: Install gh-aw - run: curl -sL https://raw.githubusercontent.com/github/gh-aw/main/install-gh-aw.sh | bash - - - name: Compile agentic workflows + - name: Check for agentic workflow files + id: check-aw-files run: | - if ls .github/workflows/*.md > /dev/null 2>&1; then - gh aw compile + if find .github/workflows -name '*.md' -print -quit 2>/dev/null | grep -q .; then + echo "found=true" >> "$GITHUB_OUTPUT" else + echo "found=false" >> "$GITHUB_OUTPUT" echo "No .github/workflows/*.md files found — skipping compile." fi + + - name: Install gh-aw + if: steps.check-aw-files.outputs.found == 'true' + # TODO: pin to a specific release tag/SHA — see https://github.com/github/gh-aw/releases + run: curl -sSfL https://raw.githubusercontent.com/github/gh-aw/main/install-gh-aw.sh | bash + + - name: Compile agentic workflows + if: steps.check-aw-files.outputs.found == 'true' + env: + GH_TOKEN: ${{ github.token }} + run: gh aw compile --no-emit diff --git a/agents/agentic-workflows.md b/agents/agentic-workflows.md new file mode 100644 index 000000000..3be578eba --- /dev/null +++ b/agents/agentic-workflows.md @@ -0,0 +1,44 @@ +--- +name: agentic-workflows +description: > + Copilot custom agent for authoring, updating, debugging, and compiling + gh-aw agentic workflow markdown files in petry-projects/.github-private. +engine: claude +tools: ["read", "search", "execute", "edit"] +--- + +You are the agentic workflow author for `petry-projects/.github-private`. + +## Engine + +This agent uses Claude via `ANTHROPIC_API_KEY` as the execution engine. + +## Responsibilities + +Use this agent to author, update, debug, and compile gh-aw agentic workflows: + +- Create new workflow markdown files in `.github/workflows/` +- Update existing workflow definitions +- Debug workflow compile or runtime errors +- Run `gh aw compile --no-emit` to validate workflows without writing output +- Write and update scenario specs in `tests/aw//README.md` + +## Available workflows + +- `issue-triage` — triages newly opened issues, applies labels, and routes to the right team +- `ci-failure-analyst` — analyzes CI failures on PRs and posts a root-cause summary + +## Authoring rules + +1. New workflow files go in `.github/workflows/.md` +2. Write scenario specs in `tests/aw//README.md` before implementing +3. Add at least one fixture payload under `tests/aw//fixtures/` +4. After writing or editing, run `gh aw compile --no-emit` to validate +5. Ensure the `gh-aw-compile` CI job passes before merging + +## Constraints + +- Never modify `.github/workflows/agent-shield.yml` +- Follow org standards in `AGENTS.md` and `petry-projects/.github/AGENTS.md` +- Use `GITHUB_TOKEN` for GitHub API calls; use `ANTHROPIC_API_KEY` for Claude invocations +- Do not store or log secrets diff --git a/tests/aw/README.md b/tests/aw/README.md index 2ede80a99..d457b306e 100644 --- a/tests/aw/README.md +++ b/tests/aw/README.md @@ -8,9 +8,9 @@ Tests follow a three-level approach: 1. **Compile validation (CI gate)** — `gh aw compile` runs on every PR that touches `.github/workflows/*.md`. A compile failure blocks merge. No runtime required. -2. **Staged smoke tests (pre-merge)** — Run a workflow against a fixture payload without posting real GitHub API side-effects. Use `--staged` to dry-run: +2. **Staged smoke tests (pre-merge)** — Run a workflow against a fixture payload without posting real GitHub API side-effects. Use `--dry-run` to validate without executing side-effects: ``` - gh aw run --staged --payload tests/aw//fixtures/.json + gh aw run --dry-run -F payload=@tests/aw//fixtures/.json ``` Smoke tests assert that the workflow reaches the expected terminal state and produces the expected output structure. @@ -42,7 +42,7 @@ A scenario spec block: ## Running compile validation locally ```bash -curl -sL https://raw.githubusercontent.com/github/gh-aw/main/install-gh-aw.sh | bash +curl -sSfL https://raw.githubusercontent.com/github/gh-aw/main/install-gh-aw.sh | bash gh aw compile ``` @@ -52,7 +52,7 @@ The compile step validates all `*.md` files in `.github/workflows/` against the ```bash # Run a single workflow against a fixture payload -gh aw run issue-triage --staged --payload tests/aw/issue-triage/fixtures/new-bug.json +gh aw run issue-triage --dry-run -F payload=@tests/aw/issue-triage/fixtures/new-bug.json # Run all smoke tests for a workflow bash tests/aw/issue-triage/smoke.sh @@ -65,6 +65,6 @@ A workflow is ready to merge when: - [ ] Scenario specs written in `tests/aw//README.md` before implementation starts - [ ] `gh aw compile` passes with no errors - [ ] At least one fixture payload exists under `tests/aw//fixtures/` -- [ ] Staged smoke test passes: `gh aw run --staged` exits 0 +- [ ] Staged smoke test passes: `gh aw run --dry-run` exits 0 - [ ] CI lint job (`gh-aw-compile`) is green on the PR - [ ] Workflow markdown reviewed by a second author or the pr-reviewer agent From f3c344cfc31d8e3b897f46024e9fd414f3ac7b5c Mon Sep 17 00:00:00 2001 From: donpetry-bot Date: Tue, 19 May 2026 02:46:18 +0000 Subject: [PATCH 03/10] chore: apply manual instructions [skip ci-relay] --- .github/workflows/lint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1df9a8538..d96508aa9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -6,6 +6,7 @@ on: - 'scripts/**' - '.github/workflows/**' - 'tests/**' + - 'agents/**' workflow_dispatch: permissions: From 7af22598fc63911fc95a5764009e7281b80c2c67 Mon Sep 17 00:00:00 2001 From: donpetry-bot Date: Tue, 19 May 2026 02:47:27 +0000 Subject: [PATCH 04/10] fix(ci): auto-fix for SonarCloud Code Analysis [skip ci-relay] --- .github/workflows/lint.yml | 5 +++-- tests/aw/README.md | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d96508aa9..456604efe 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -54,8 +54,9 @@ jobs: - name: Install gh-aw if: steps.check-aw-files.outputs.found == 'true' - # TODO: pin to a specific release tag/SHA — see https://github.com/github/gh-aw/releases - run: curl -sSfL https://raw.githubusercontent.com/github/gh-aw/main/install-gh-aw.sh | bash + env: + GH_TOKEN: ${{ github.token }} + run: gh extension install github/gh-aw - name: Compile agentic workflows if: steps.check-aw-files.outputs.found == 'true' diff --git a/tests/aw/README.md b/tests/aw/README.md index d457b306e..8bd164c65 100644 --- a/tests/aw/README.md +++ b/tests/aw/README.md @@ -42,7 +42,7 @@ A scenario spec block: ## Running compile validation locally ```bash -curl -sSfL https://raw.githubusercontent.com/github/gh-aw/main/install-gh-aw.sh | bash +gh extension install github/gh-aw gh aw compile ``` From af0907235735e7cb2b4e577a7bd1a82f4518bc17 Mon Sep 17 00:00:00 2001 From: donpetry-bot Date: Tue, 19 May 2026 02:53:32 +0000 Subject: [PATCH 05/10] fix(ci): auto-fix for SonarCloud Code Analysis [skip ci-relay] --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 456604efe..33b0b2ab8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -56,7 +56,7 @@ jobs: if: steps.check-aw-files.outputs.found == 'true' env: GH_TOKEN: ${{ github.token }} - run: gh extension install github/gh-aw + run: gh extension install github/gh-aw --pin v0.74.4 - name: Compile agentic workflows if: steps.check-aw-files.outputs.found == 'true' From c3d3eaa7df62e264a5a7e801b8a3eab882d7d47c Mon Sep 17 00:00:00 2001 From: donpetry-bot Date: Tue, 19 May 2026 02:57:07 +0000 Subject: [PATCH 06/10] chore: apply manual instructions [skip ci-relay] --- AGENTS.md | 4 ++++ tests/aw/README.md | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index a6326b97a..bb94086c1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -26,6 +26,10 @@ This is the `.github-private` org infrastructure repo for `petry-projects`. It c To change behavior across all org repos (via the cross-repo reusable), edit `dev-lead-reusable.yml`. - All other workflow changes must use templates from [`standards/workflows/`](https://github.com/petry-projects/.github/tree/main/standards/workflows) verbatim. +- **Exception:** The `gh-aw-compile` job in `lint.yml` is a documented repo-specific addition that gates + agentic workflow compilation. It is not covered by the org template and must not be removed by template + syncs. If the org template gains a `gh-aw-compile` equivalent, remove this exception and defer to the + template instead. ### Agent Profiles (`agents/*.md`) diff --git a/tests/aw/README.md b/tests/aw/README.md index 8bd164c65..d87e8daef 100644 --- a/tests/aw/README.md +++ b/tests/aw/README.md @@ -42,7 +42,7 @@ A scenario spec block: ## Running compile validation locally ```bash -gh extension install github/gh-aw +gh extension install github/gh-aw --pin v0.74.4 gh aw compile ``` From 9d2f609af47d342e8580f4a1285d66825eda1100 Mon Sep 17 00:00:00 2001 From: donpetry-bot Date: Tue, 19 May 2026 23:07:44 +0000 Subject: [PATCH 07/10] fix(reviews): address review comments [skip ci-relay] --- .github/workflows/lint.yml | 36 ++++++++++++++++++++++++++++++++++-- agents/agentic-workflows.md | 2 +- tests/aw/README.md | 9 ++++----- 3 files changed, 39 insertions(+), 8 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 33b0b2ab8..0d86edf69 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -36,6 +36,38 @@ jobs: - name: Run tests run: bats tests/fleet_report.bats + validate-agent-profiles: + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Validate agent profile frontmatter + run: | + set -euo pipefail + fail=0 + for f in agents/*.md; do + [ -e "$f" ] || continue + name_from_file=$(basename "$f" .md) + frontmatter=$(awk 'BEGIN{found=0} /^---/{found++; if(found==2) exit; next} found==1{print}' "$f") + name_from_front=$(printf '%s\n' "$frontmatter" | grep '^name:' | awk '{print $2}' | head -1) + if [ -z "$name_from_front" ]; then + echo "FAIL: $f — missing 'name' field in frontmatter" + fail=1 + elif [ "$name_from_front" != "$name_from_file" ]; then + echo "FAIL: $f — name '$name_from_front' does not match filename '$name_from_file'" + fail=1 + fi + for field in description tools; do + if ! printf '%s\n' "$frontmatter" | grep -q "^${field}:"; then + echo "FAIL: $f — missing '${field}' field in frontmatter" + fail=1 + fi + done + echo "OK: $f" + done + [ "$fail" -eq 0 ] || exit 1 + gh-aw-compile: runs-on: ubuntu-latest timeout-minutes: 5 @@ -45,11 +77,11 @@ jobs: - name: Check for agentic workflow files id: check-aw-files run: | - if find .github/workflows -name '*.md' -print -quit 2>/dev/null | grep -q .; then + if find .github/workflows \( -name '*.md' -o -name '*.lock.yml' \) -print -quit 2>/dev/null | grep -q .; then echo "found=true" >> "$GITHUB_OUTPUT" else echo "found=false" >> "$GITHUB_OUTPUT" - echo "No .github/workflows/*.md files found — skipping compile." + echo "No .github/workflows/*.md or *.lock.yml files found — skipping compile." fi - name: Install gh-aw diff --git a/agents/agentic-workflows.md b/agents/agentic-workflows.md index 3be578eba..197817af7 100644 --- a/agents/agentic-workflows.md +++ b/agents/agentic-workflows.md @@ -3,7 +3,7 @@ name: agentic-workflows description: > Copilot custom agent for authoring, updating, debugging, and compiling gh-aw agentic workflow markdown files in petry-projects/.github-private. -engine: claude +model: claude tools: ["read", "search", "execute", "edit"] --- diff --git a/tests/aw/README.md b/tests/aw/README.md index d87e8daef..c9439daac 100644 --- a/tests/aw/README.md +++ b/tests/aw/README.md @@ -8,11 +8,10 @@ Tests follow a three-level approach: 1. **Compile validation (CI gate)** — `gh aw compile` runs on every PR that touches `.github/workflows/*.md`. A compile failure blocks merge. No runtime required. -2. **Staged smoke tests (pre-merge)** — Run a workflow against a fixture payload without posting real GitHub API side-effects. Use `--dry-run` to validate without executing side-effects: +2. **Staged smoke tests (pre-merge)** — Run a workflow against a fixture payload without posting real GitHub API side-effects. Use `--dry-run` to validate the trigger request without dispatching a run: ``` gh aw run --dry-run -F payload=@tests/aw//fixtures/.json ``` - Smoke tests assert that the workflow reaches the expected terminal state and produces the expected output structure. 3. **Integration tests (manual / scheduled)** — Execute against a real GitHub event in a sandbox repo. Reserved for release-gate validation; not required on every PR. @@ -46,13 +45,13 @@ gh extension install github/gh-aw --pin v0.74.4 gh aw compile ``` -The compile step validates all `*.md` files in `.github/workflows/` against the gh-aw schema. It does not invoke Claude or make API calls. +The compile step validates all `*.md` files in `.github/workflows/` against the gh-aw schema. It does not invoke Claude, but may query the GitHub API to resolve and pin action references; set `GH_TOKEN` before running if action resolution fails. ## Running staged smoke tests ```bash # Run a single workflow against a fixture payload -gh aw run issue-triage --dry-run -F payload=@tests/aw/issue-triage/fixtures/new-bug.json +gh aw run issue-triage -F payload=@tests/aw/issue-triage/fixtures/new-bug.json # Run all smoke tests for a workflow bash tests/aw/issue-triage/smoke.sh @@ -65,6 +64,6 @@ A workflow is ready to merge when: - [ ] Scenario specs written in `tests/aw//README.md` before implementation starts - [ ] `gh aw compile` passes with no errors - [ ] At least one fixture payload exists under `tests/aw//fixtures/` -- [ ] Staged smoke test passes: `gh aw run --dry-run` exits 0 +- [ ] Staged smoke test passes: `gh aw run ` exits 0 - [ ] CI lint job (`gh-aw-compile`) is green on the PR - [ ] Workflow markdown reviewed by a second author or the pr-reviewer agent From 9edb44f699845ddf135cb33a8a35dab22bdeb510 Mon Sep 17 00:00:00 2001 From: donpetry-bot Date: Tue, 19 May 2026 23:20:36 +0000 Subject: [PATCH 08/10] fix(reviews): address review comments [skip ci-relay] --- .github/workflows/lint.yml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0d86edf69..297518ec4 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -49,8 +49,18 @@ jobs: for f in agents/*.md; do [ -e "$f" ] || continue name_from_file=$(basename "$f" .md) + if ! awk 'BEGIN{found=0} /^---/{found++; if(found==2) exit} END{exit (found<2)}' "$f"; then + echo "FAIL: $f — frontmatter is not closed (missing closing '---')" + fail=1 + continue + fi frontmatter=$(awk 'BEGIN{found=0} /^---/{found++; if(found==2) exit; next} found==1{print}' "$f") - name_from_front=$(printf '%s\n' "$frontmatter" | grep '^name:' | awk '{print $2}' | head -1) + if ! printf '%s\n' "$frontmatter" | python3 -c "import sys, yaml; yaml.safe_load(sys.stdin)" 2>/dev/null; then + echo "FAIL: $f — invalid YAML in frontmatter" + fail=1 + continue + fi + name_from_front=$(printf '%s\n' "$frontmatter" | grep '^name:' | sed 's/^name:[[:space:]]*//' | sed "s/^['\"]//;s/['\"]$//" | head -1) if [ -z "$name_from_front" ]; then echo "FAIL: $f — missing 'name' field in frontmatter" fail=1 @@ -95,3 +105,17 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: gh aw compile --no-emit + + - name: Detect orphaned lock files + if: steps.check-aw-files.outputs.found == 'true' + run: | + orphan=0 + for lock in .github/workflows/*.lock.yml; do + [ -e "$lock" ] || continue + md="${lock%.lock.yml}.md" + if [ ! -f "$md" ]; then + echo "FAIL: orphaned lock file $lock — no corresponding source $md" + orphan=1 + fi + done + [ "$orphan" -eq 0 ] || exit 1 From 3db690c0f243dfda59742125dabeb94c35d07c89 Mon Sep 17 00:00:00 2001 From: donpetry-bot Date: Wed, 20 May 2026 01:47:41 +0000 Subject: [PATCH 09/10] fix(reviews): address review comments [skip ci-relay] --- .github/workflows/lint.yml | 15 ++++++++++----- tests/aw/README.md | 6 +++--- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 297518ec4..c3a17ce73 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -42,6 +42,9 @@ jobs: steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Install PyYAML + run: pip3 install --quiet pyyaml + - name: Validate agent profile frontmatter run: | set -euo pipefail @@ -49,8 +52,8 @@ jobs: for f in agents/*.md; do [ -e "$f" ] || continue name_from_file=$(basename "$f" .md) - if ! awk 'BEGIN{found=0} /^---/{found++; if(found==2) exit} END{exit (found<2)}' "$f"; then - echo "FAIL: $f — frontmatter is not closed (missing closing '---')" + if ! awk 'NR==1 && $0!="---"{exit 1} /^---/{n++; if(n==2) exit} END{exit (n<2)}' "$f"; then + echo "FAIL: $f — frontmatter missing or does not begin on line 1" fail=1 continue fi @@ -67,6 +70,9 @@ jobs: elif [ "$name_from_front" != "$name_from_file" ]; then echo "FAIL: $f — name '$name_from_front' does not match filename '$name_from_file'" fail=1 + elif ! printf '%s\n' "$name_from_file" | grep -qE '^[a-z0-9]+(-[a-z0-9]+)*$'; then + echo "FAIL: $f — name '$name_from_file' is not kebab-case (only lowercase letters, digits, and hyphens)" + fail=1 fi for field in description tools; do if ! printf '%s\n' "$frontmatter" | grep -q "^${field}:"; then @@ -110,12 +116,11 @@ jobs: if: steps.check-aw-files.outputs.found == 'true' run: | orphan=0 - for lock in .github/workflows/*.lock.yml; do - [ -e "$lock" ] || continue + while IFS= read -r lock; do md="${lock%.lock.yml}.md" if [ ! -f "$md" ]; then echo "FAIL: orphaned lock file $lock — no corresponding source $md" orphan=1 fi - done + done < <(find .github/workflows -name '*.lock.yml') [ "$orphan" -eq 0 ] || exit 1 diff --git a/tests/aw/README.md b/tests/aw/README.md index c9439daac..33605d97f 100644 --- a/tests/aw/README.md +++ b/tests/aw/README.md @@ -50,8 +50,8 @@ The compile step validates all `*.md` files in `.github/workflows/` against the ## Running staged smoke tests ```bash -# Run a single workflow against a fixture payload -gh aw run issue-triage -F payload=@tests/aw/issue-triage/fixtures/new-bug.json +# Run a single workflow against a fixture payload (dry-run: no real GitHub API side-effects) +gh aw run issue-triage --dry-run -F payload=@tests/aw/issue-triage/fixtures/new-bug.json # Run all smoke tests for a workflow bash tests/aw/issue-triage/smoke.sh @@ -64,6 +64,6 @@ A workflow is ready to merge when: - [ ] Scenario specs written in `tests/aw//README.md` before implementation starts - [ ] `gh aw compile` passes with no errors - [ ] At least one fixture payload exists under `tests/aw//fixtures/` -- [ ] Staged smoke test passes: `gh aw run ` exits 0 +- [ ] Staged smoke test passes: `gh aw run --wait` exits 0 - [ ] CI lint job (`gh-aw-compile`) is green on the PR - [ ] Workflow markdown reviewed by a second author or the pr-reviewer agent From 21cc4c4f4e0ff54fbc7b2acb7be768465cf1f770 Mon Sep 17 00:00:00 2001 From: donpetry-bot Date: Wed, 20 May 2026 02:56:55 +0000 Subject: [PATCH 10/10] fix(reviews): address review comments [skip ci-relay] --- tests/aw/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/aw/README.md b/tests/aw/README.md index 33605d97f..e008c7666 100644 --- a/tests/aw/README.md +++ b/tests/aw/README.md @@ -64,6 +64,6 @@ A workflow is ready to merge when: - [ ] Scenario specs written in `tests/aw//README.md` before implementation starts - [ ] `gh aw compile` passes with no errors - [ ] At least one fixture payload exists under `tests/aw//fixtures/` -- [ ] Staged smoke test passes: `gh aw run --wait` exits 0 +- [ ] Staged smoke test passes: `gh aw run ` exits 0 - [ ] CI lint job (`gh-aw-compile`) is green on the PR - [ ] Workflow markdown reviewed by a second author or the pr-reviewer agent