Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
8456717
feat: Phase 0 — install and initialize gh-aw in .github-private (clos…
May 18, 2026
788f6cd
Merge branch 'main' into dev-lead/issue-230-20260518-1642
don-petry May 18, 2026
8d5ac05
Merge branch 'main' into dev-lead/issue-230-20260518-1642
don-petry May 18, 2026
2136990
Merge branch 'main' into dev-lead/issue-230-20260518-1642
don-petry May 18, 2026
0472e86
Merge branch 'main' into dev-lead/issue-230-20260518-1642
don-petry May 19, 2026
6d3902c
Merge branch 'main' into dev-lead/issue-230-20260518-1642
don-petry May 19, 2026
b0707af
chore: apply manual instructions [skip ci-relay]
donpetry-bot May 19, 2026
f3c344c
chore: apply manual instructions [skip ci-relay]
donpetry-bot May 19, 2026
7af2259
fix(ci): auto-fix for SonarCloud Code Analysis [skip ci-relay]
donpetry-bot May 19, 2026
af09072
fix(ci): auto-fix for SonarCloud Code Analysis [skip ci-relay]
donpetry-bot May 19, 2026
c3d3eaa
chore: apply manual instructions [skip ci-relay]
donpetry-bot May 19, 2026
4d5637c
Merge branch 'main' into dev-lead/issue-230-20260518-1642
don-petry May 19, 2026
c8080c0
Merge branch 'main' into dev-lead/issue-230-20260518-1642
don-petry May 19, 2026
59b0e8f
Merge branch 'main' into dev-lead/issue-230-20260518-1642
don-petry May 19, 2026
9d2f609
fix(reviews): address review comments [skip ci-relay]
donpetry-bot May 19, 2026
9edb44f
fix(reviews): address review comments [skip ci-relay]
donpetry-bot May 19, 2026
8c12622
Merge branch 'main' into dev-lead/issue-230-20260518-1642
don-petry May 20, 2026
3db690c
fix(reviews): address review comments [skip ci-relay]
donpetry-bot May 20, 2026
ace0631
Merge branch 'main' into dev-lead/issue-230-20260518-1642
don-petry May 20, 2026
04ee301
Merge branch 'main' into dev-lead/issue-230-20260518-1642
don-petry May 20, 2026
21cc4c4
fix(reviews): address review comments [skip ci-relay]
donpetry-bot May 20, 2026
13479f7
Merge branch 'main' into dev-lead/issue-230-20260518-1642
don-petry May 20, 2026
23556eb
Merge branch 'main' into dev-lead/issue-230-20260518-1642
don-petry May 20, 2026
e16e7ca
Merge branch 'main' into dev-lead/issue-230-20260518-1642
don-petry May 20, 2026
ff2fc97
Merge branch 'main' into dev-lead/issue-230-20260518-1642
don-petry May 20, 2026
cba0449
Merge branch 'main' into dev-lead/issue-230-20260518-1642
don-petry May 20, 2026
a7bb213
Merge branch 'main' into dev-lead/issue-230-20260518-1642
don-petry May 20, 2026
5e2b544
Merge branch 'main' into dev-lead/issue-230-20260518-1642
don-petry May 20, 2026
8bf73b4
Merge branch 'main' into dev-lead/issue-230-20260518-1642
don-petry May 20, 2026
a900c25
Merge branch 'main' into dev-lead/issue-230-20260518-1642
don-petry May 20, 2026
bf14278
Merge branch 'main' into dev-lead/issue-230-20260518-1642
don-petry May 20, 2026
2d51e10
Merge branch 'main' into dev-lead/issue-230-20260518-1642
don-petry May 20, 2026
a74527e
Merge branch 'main' into dev-lead/issue-230-20260518-1642
don-petry May 20, 2026
760d1f9
Merge branch 'main' into dev-lead/issue-230-20260518-1642
don-petry May 20, 2026
e5fd179
Merge branch 'main' into dev-lead/issue-230-20260518-1642
don-petry May 20, 2026
3c94ddb
Merge branch 'main' into dev-lead/issue-230-20260518-1642
don-petry May 20, 2026
6c5d13a
Merge branch 'main' into dev-lead/issue-230-20260518-1642
don-petry May 20, 2026
72b5dd2
Merge branch 'main' into dev-lead/issue-230-20260518-1642
don-petry May 20, 2026
08568df
Merge branch 'main' into dev-lead/issue-230-20260518-1642
don-petry May 20, 2026
210931e
Merge branch 'main' into dev-lead/issue-230-20260518-1642
don-petry May 20, 2026
2ba36c7
Merge branch 'main' into dev-lead/issue-230-20260518-1642
don-petry May 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- 'scripts/**'
- '.github/workflows/**'
- 'tests/**'
- 'agents/**'
Comment thread
don-petry marked this conversation as resolved.
workflow_dispatch:

permissions:
Expand Down Expand Up @@ -34,3 +35,92 @@ jobs:

- name: Run tests
run: bats tests/fleet_report.bats

validate-agent-profiles:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Move custom profile-validation job out of template file

lint.yml is a template-managed workflow in this repo, and this commit only documents gh-aw-compile as the allowed repo-specific exception in AGENTS.md; adding another repo-specific job (validate-agent-profiles) here creates unmanaged drift. On the next template sync, this job can be overwritten and agent-profile validation will silently disappear, so the check should be moved into the org template/reusable path or explicitly added as a documented exception alongside gh-aw-compile.

Useful? React with 👍 / 👎.

runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Install PyYAML
run: pip3 install --quiet pyyaml

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Pin the PyYAML dependency for deterministic CI

Installing pyyaml without a version pin makes this required lint job depend on whatever package version is current on PyPI at run time, so unrelated PRs can start failing when upstream releases change behavior or publish a bad build. Because this job runs on broad path filters, that nondeterminism affects many changes outside agent profiles; pinning an explicit version (or vendoring a parser) keeps validation stable and reproducible.

Useful? React with 👍 / 👎.


- 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)
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
frontmatter=$(awk 'BEGIN{found=0} /^---/{found++; if(found==2) exit; next} found==1{print}' "$f")
Comment thread
don-petry marked this conversation as resolved.
if ! printf '%s\n' "$frontmatter" | python3 -c "import sys, yaml; yaml.safe_load(sys.stdin)" 2>/dev/null; then
Comment thread
don-petry marked this conversation as resolved.
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
elif [ "$name_from_front" != "$name_from_file" ]; then
echo "FAIL: $f — name '$name_from_front' does not match filename '$name_from_file'"
Comment thread
don-petry marked this conversation as resolved.
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
echo "FAIL: $f — missing '${field}' field in frontmatter"
Comment thread
don-petry marked this conversation as resolved.
fail=1
fi
done
echo "OK: $f"
done
[ "$fail" -eq 0 ] || exit 1

gh-aw-compile:
runs-on: ubuntu-latest
timeout-minutes: 5
Comment thread
don-petry marked this conversation as resolved.
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Check for agentic workflow files
id: check-aw-files
run: |
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 or *.lock.yml files found — skipping compile."
fi

- name: Install gh-aw
if: steps.check-aw-files.outputs.found == 'true'
env:
GH_TOKEN: ${{ github.token }}
run: gh extension install github/gh-aw --pin v0.74.4

- name: Compile agentic workflows
if: steps.check-aw-files.outputs.found == 'true'
env:
GH_TOKEN: ${{ github.token }}
run: gh aw compile --no-emit
Comment thread
don-petry marked this conversation as resolved.

- name: Detect orphaned lock files
if: steps.check-aw-files.outputs.found == 'true'
run: |
orphan=0
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 < <(find .github/workflows -name '*.lock.yml')
[ "$orphan" -eq 0 ] || exit 1
4 changes: 4 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`)

Expand Down
44 changes: 44 additions & 0 deletions agents/agentic-workflows.md
Original file line number Diff line number Diff line change
@@ -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.
model: 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/<name>/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/<name>.md`
2. Write scenario specs in `tests/aw/<name>/README.md` before implementing
3. Add at least one fixture payload under `tests/aw/<name>/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
69 changes: 69 additions & 0 deletions tests/aw/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# 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 `--dry-run` to validate the trigger request without dispatching a run:
```
gh aw run <workflow-name> --dry-run -F payload=@tests/aw/<workflow-name>/fixtures/<fixture>.json
```

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/<workflow-name>/` as a plain markdown file:

```
tests/aw/<workflow-name>/
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: <name>

**Given** <precondition>
**When** <event / trigger>
**Then** <expected outcome>

**Fixture:** `fixtures/<name>.json`
```

## Running compile validation locally

```bash
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, 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 (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
```

## Definition of Done checklist

A workflow is ready to merge when:

- [ ] Scenario specs written in `tests/aw/<name>/README.md` before implementation starts
- [ ] `gh aw compile` passes with no errors
- [ ] At least one fixture payload exists under `tests/aw/<name>/fixtures/`
- [ ] Staged smoke test passes: `gh aw run <name>` 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
Empty file.
Empty file.
Loading