From 47a8616bb685fd895bb8444566024f79f73fd3f6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 23 May 2026 14:13:17 +0000 Subject: [PATCH 1/6] Normalize agent workflow temp paths Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .github/workflows/ab-testing-advisor.md | 4 +- .github/workflows/agentic-token-audit.md | 34 +++---- .github/workflows/agentic-token-optimizer.md | 22 ++--- .github/workflows/approach-validator.md | 30 +++---- .github/workflows/aw-failure-investigator.md | 10 +-- .github/workflows/aw-portfolio-yield.md | 18 ++-- .github/workflows/ci-coach.md | 24 ++--- .github/workflows/ci-doctor.md | 44 +++++----- .github/workflows/cloclo.md | 2 +- .github/workflows/copilot-agent-analysis.md | 10 +-- .github/workflows/copilot-opt.md | 18 ++-- .github/workflows/copilot-pr-merged-report.md | 6 +- .github/workflows/copilot-pr-nlp-analysis.md | 30 +++---- .../workflows/copilot-pr-prompt-analysis.md | 6 +- .github/workflows/copilot-session-insights.md | 36 ++++---- .../daily-agentrx-trace-optimizer.md | 34 +++---- ...aily-astrostylelite-markdown-spellcheck.md | 30 +++---- .../daily-aw-cross-repo-compile-check.md | 4 +- .github/workflows/daily-cli-performance.md | 52 +++++------ .github/workflows/daily-cli-tools-tester.md | 8 +- .github/workflows/daily-geo-optimizer.md | 18 ++-- ...ly-grafana-otel-instrumentation-advisor.md | 2 +- .github/workflows/daily-issues-report.md | 4 +- .../workflows/daily-malicious-code-scan.md | 6 +- .github/workflows/daily-model-inventory.md | 56 ++++++------ .../daily-multi-device-docs-tester.md | 8 +- .github/workflows/daily-news.md | 38 ++++---- .../daily-otel-instrumentation-advisor.md | 2 +- .github/workflows/daily-regulatory.md | 6 +- .../daily-rendering-scripts-verifier.md | 12 +-- .../workflows/daily-safe-output-integrator.md | 4 +- .../daily-safe-outputs-conformance.md | 12 +-- .github/workflows/daily-secrets-analysis.md | 12 +-- .../workflows/daily-security-observability.md | 50 +++++------ .github/workflows/daily-security-red-team.md | 88 +++++++++---------- .github/workflows/daily-sentrux-report.md | 4 +- .github/workflows/daily-skill-optimizer.md | 10 +-- .../workflows/daily-syntax-error-quality.md | 16 ++-- .../daily-testify-uber-super-expert.md | 10 +-- .../dataflow-pr-discussion-dataset.md | 66 +++++++------- .github/workflows/deep-report.md | 24 ++--- .github/workflows/docs-noob-tester.md | 24 ++--- .github/workflows/firewall-escape.md | 10 +-- .github/workflows/go-pattern-detector.md | 6 +- .github/workflows/gpclean.md | 20 ++--- .github/workflows/issue-arborist.md | 32 +++---- .github/workflows/layout-spec-maintainer.md | 2 +- .github/workflows/mergefest.md | 2 +- .github/workflows/org-health-report.md | 26 +++--- .../workflows/otlp-data-quality-validator.md | 22 ++--- .github/workflows/outcome-collector.md | 8 +- .../workflows/prompt-clustering-analysis.md | 74 ++++++++-------- .github/workflows/release.md | 70 +++++++-------- .github/workflows/repo-audit-analyzer.md | 26 +++--- .github/workflows/shared/ci-data-analysis.md | 38 ++++---- .../shared/ci-optimization-strategies.md | 8 +- .../shared/copilot-pr-analysis-base.md | 8 +- .../workflows/shared/copilot-pr-data-fetch.md | 38 ++++---- .../shared/copilot-session-data-fetch.md | 76 ++++++++-------- .../shared/discussions-data-fetch.md | 58 ++++++------ .../workflows/shared/docs-server-lifecycle.md | 20 ++--- .github/workflows/shared/ffmpeg.md | 6 +- .github/workflows/shared/genaiscript.md | 18 ++-- .github/workflows/shared/issues-data-fetch.md | 46 +++++----- .github/workflows/shared/mcp/drain3.md | 10 +-- .github/workflows/shared/mcp/sentrux.md | 6 +- .github/workflows/shared/metrics-patterns.md | 32 +++---- .../workflows/shared/ollama-threat-scan.md | 18 ++-- .github/workflows/shared/python-dataviz.md | 18 ++-- .github/workflows/shared/python-nlp.md | 12 +-- .../workflows/shared/secret-redaction-test.md | 4 +- .../shared/trending-charts-simple.md | 8 +- .github/workflows/shared/trufflehog.md | 23 +++-- .../shared/weekly-issues-data-fetch.md | 52 +++++------ .github/workflows/slide-deck-maintainer.md | 14 +-- .github/workflows/smoke-claude.md | 2 +- .github/workflows/smoke-codex.md | 2 +- .github/workflows/smoke-copilot-arm.md | 2 +- .github/workflows/smoke-copilot.md | 2 +- .github/workflows/smoke-crush.md | 2 +- .github/workflows/smoke-gemini.md | 4 +- .github/workflows/smoke-opencode.md | 2 +- .github/workflows/smoke-otel-backends.md | 22 ++--- .github/workflows/smoke-pi.md | 4 +- .github/workflows/spec-extractor.md | 8 +- .github/workflows/stale-repo-identifier.md | 12 +-- .github/workflows/static-analysis-report.md | 16 ++-- .github/workflows/super-linter.md | 4 +- .github/workflows/update-astro.md | 8 +- .../workflows/visual-regression-checker.md | 14 +-- .github/workflows/weekly-blog-post-writer.md | 8 +- .../workflows/weekly-editors-health-check.md | 2 +- 92 files changed, 909 insertions(+), 910 deletions(-) diff --git a/.github/workflows/ab-testing-advisor.md b/.github/workflows/ab-testing-advisor.md index 4074cd12613..d4a4de0ede8 100644 --- a/.github/workflows/ab-testing-advisor.md +++ b/.github/workflows/ab-testing-advisor.md @@ -268,7 +268,7 @@ Show the concrete before/after diff. - [ ] Add `experiments:` section to frontmatter - [ ] Add conditional blocks to workflow prompt body using `{{#if experiments. == "" }}` (value-comparison form — never use the internal `__GH_AW_EXPERIMENTS__` env-var syntax) - [ ] Run `gh aw compile ` to regenerate lock file -- [ ] Monitor experiment artifact uploaded per run to `/tmp/gh-aw/experiments/state.json` +- [ ] Monitor experiment artifact uploaded per run to `/tmp/gh-aw/agent/experiments/state.json` - [ ] After sufficient runs, analyze variant distribution via workflow run artifacts - [ ] Document findings and promote winning variant @@ -307,7 +307,7 @@ After completing the primary quest, include a **second issue** (sub-issue of the Use the `field-presence-checker` agent with file paths `pkg/workflow/compiler_experiments.go` and `actions/setup/js/pick_experiment.cjs`, and field names `analysis_type`, `tags`, `notify`. Use the returned `present`/`evidence` results when deciding which fields are genuinely absent. -Then review what data is currently captured per experiment run (the artifact uploaded to `/tmp/gh-aw/experiments/state.json`) and consider what would be needed for a complete experiment analytics pipeline. +Then review what data is currently captured per experiment run (the artifact uploaded to `/tmp/gh-aw/agent/experiments/state.json`) and consider what would be needed for a complete experiment analytics pipeline. Propose concrete improvements in the following areas: diff --git a/.github/workflows/agentic-token-audit.md b/.github/workflows/agentic-token-audit.md index 618882c5979..2057c86f61c 100644 --- a/.github/workflows/agentic-token-audit.md +++ b/.github/workflows/agentic-token-audit.md @@ -36,16 +36,16 @@ steps: python-version: "3.12" - name: Setup local chart workspace run: | - mkdir -p /tmp/gh-aw/token-audit/charts /tmp/gh-aw/token-audit/site-packages + mkdir -p /tmp/gh-aw/agent/token-audit/charts /tmp/gh-aw/agent/token-audit/site-packages - name: Install Python chart dependencies run: | - python3 -m pip install --quiet --target /tmp/gh-aw/token-audit/site-packages pandas matplotlib seaborn + python3 -m pip install --quiet --target /tmp/gh-aw/agent/token-audit/site-packages pandas matplotlib seaborn - name: Download agentic workflow logs env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | set -euo pipefail - mkdir -p /tmp/gh-aw/token-audit + mkdir -p /tmp/gh-aw/agent/token-audit # Download last 24 hours of agentic workflow logs as JSON # Allow partial results — gh aw logs streams incrementally, so even if @@ -56,17 +56,17 @@ steps: --start-date -1d \ --json \ -c 100 \ - > /tmp/gh-aw/token-audit/workflow-logs.json || LOGS_EXIT=$? + > /tmp/gh-aw/agent/token-audit/workflow-logs.json || LOGS_EXIT=$? - if [ -s /tmp/gh-aw/token-audit/workflow-logs.json ]; then - TOTAL=$(jq '.runs | length' /tmp/gh-aw/token-audit/workflow-logs.json) + if [ -s /tmp/gh-aw/agent/token-audit/workflow-logs.json ]; then + TOTAL=$(jq '.runs | length' /tmp/gh-aw/agent/token-audit/workflow-logs.json) echo "✅ Downloaded $TOTAL agentic workflow runs (last 24 hours)" if [ "$LOGS_EXIT" -ne 0 ]; then echo "⚠️ gh aw logs exited with code $LOGS_EXIT (partial results — likely API rate limit)" fi else echo "❌ No log data downloaded (exit code $LOGS_EXIT)" - echo '{"runs":[],"summary":{}}' > /tmp/gh-aw/token-audit/workflow-logs.json + echo '{"runs":[],"summary":{}}' > /tmp/gh-aw/agent/token-audit/workflow-logs.json fi timeout-minutes: 25 source: githubnext/agentic-ops/workflows/agentic-token-audit.md@e10687ae8f19a5b37b061db524be27948568c411 @@ -86,7 +86,7 @@ You are the Agentic Workflow Token Auditor — a workflow that tracks daily toke ### Pre-downloaded logs -The workflow logs are at `/tmp/gh-aw/token-audit/workflow-logs.json`. The file is the raw JSON output of `gh aw logs --json` with this top-level shape: +The workflow logs are at `/tmp/gh-aw/agent/token-audit/workflow-logs.json`. The file is the raw JSON output of `gh aw logs --json` with this top-level shape: ```json { @@ -125,15 +125,15 @@ Previous snapshots live at `/tmp/gh-aw/repo-memory/default/`. Each daily snapsho ## Phase 1 — Process Logs -Write a Python script to `/tmp/gh-aw/token-audit/process_audit.py` and run it. The script must: +Write a Python script to `/tmp/gh-aw/agent/token-audit/process_audit.py` and run it. The script must: -1. Load `/tmp/gh-aw/token-audit/workflow-logs.json` and extract `.runs`. +1. Load `/tmp/gh-aw/agent/token-audit/workflow-logs.json` and extract `.runs`. 2. Filter to `status == "completed"` runs only. 3. Group by `workflow_name` and compute per-workflow aggregates: - `run_count`, `total_tokens`, `avg_tokens`, `total_cost`, `avg_cost`, `total_turns`, `avg_turns`, `total_action_minutes`, `error_count`, `warning_count` 4. Compute an overall summary: total runs, total tokens, total cost, total action minutes. 5. Sort workflows descending by `total_tokens`. -6. Save the result to `/tmp/gh-aw/token-audit/audit_snapshot.json` with this shape: +6. Save the result to `/tmp/gh-aw/agent/token-audit/audit_snapshot.json` with this shape: ```json { @@ -168,7 +168,7 @@ Handle null/missing `token_usage` and `estimated_cost` by treating them as 0. ## Phase 2 — Persist Snapshot to Repo-Memory -1. Read the snapshot from `/tmp/gh-aw/token-audit/audit_snapshot.json`. +1. Read the snapshot from `/tmp/gh-aw/agent/token-audit/audit_snapshot.json`. 2. Copy it to `/tmp/gh-aw/repo-memory/default/YYYY-MM-DD.json` (today's UTC date). 3. This file is what the optimizer workflow reads to identify high-usage workflows. @@ -183,14 +183,14 @@ Report those two cases differently in the issue as described below so the empty- ## Phase 3 — Generate Charts -Create up to two chart images in `/tmp/gh-aw/token-audit/charts/` using Python, `matplotlib`, and `seaborn` with `whitegrid` styling: +Create up to two chart images in `/tmp/gh-aw/agent/token-audit/charts/` using Python, `matplotlib`, and `seaborn` with `whitegrid` styling: 1. **Token usage by workflow** (`token_by_workflow.png`): a horizontal bar chart of the top 15 workflows by total tokens from `audit_snapshot.json`. 2. **Historical token trend** (`token_trend.png`): a line chart from `rolling-summary.json`. Chart requirements: -- The preinstalled Python packages live in `/tmp/gh-aw/token-audit/site-packages`. Set `PYTHONPATH=/tmp/gh-aw/token-audit/site-packages${PYTHONPATH:+:$PYTHONPATH}` for every Python command that imports `pandas`, `matplotlib`, or `seaborn`, for example: `PYTHONPATH=/tmp/gh-aw/token-audit/site-packages${PYTHONPATH:+:$PYTHONPATH} python3 /tmp/gh-aw/token-audit/process_audit.py`. +- The preinstalled Python packages live in `/tmp/gh-aw/agent/token-audit/site-packages`. Set `PYTHONPATH=/tmp/gh-aw/agent/token-audit/site-packages${PYTHONPATH:+:$PYTHONPATH}` for every Python command that imports `pandas`, `matplotlib`, or `seaborn`, for example: `PYTHONPATH=/tmp/gh-aw/agent/token-audit/site-packages${PYTHONPATH:+:$PYTHONPATH} python3 /tmp/gh-aw/agent/token-audit/process_audit.py`. - Use 300 DPI and a white background. - Add clear axis labels and titles. - Save only PNG files. @@ -269,12 +269,12 @@ Summarize token and cost changes from `rolling-summary.json` when historical dat ## Experiment OTEL Span Attributes -If the file `/tmp/gh-aw/experiments/assignments.json` exists, read it and emit one OTEL span +If the file `/tmp/gh-aw/agent/experiments/assignments.json` exists, read it and emit one OTEL span attribute per experiment using the `otlp.cjs` `logSpan` helper: ```javascript const fs = require('fs'); -const assignmentsFile = '/tmp/gh-aw/experiments/assignments.json'; +const assignmentsFile = '/tmp/gh-aw/agent/experiments/assignments.json'; if (fs.existsSync(assignmentsFile)) { const assignments = JSON.parse(fs.readFileSync(assignmentsFile, 'utf8')); const names = Object.keys(assignments).sort(); @@ -283,7 +283,7 @@ if (fs.existsSync(assignmentsFile)) { for (const name of names) { attrs[`gh_aw.experiment.${name}`] = assignments[name]; } - const otlp = require('/tmp/gh-aw/actions/otlp.cjs'); + const otlp = require('/tmp/gh-aw/agent/actions/otlp.cjs'); await otlp.logSpan('experiment', attrs); } } diff --git a/.github/workflows/agentic-token-optimizer.md b/.github/workflows/agentic-token-optimizer.md index 7b380b14ce7..aa6720c7b05 100644 --- a/.github/workflows/agentic-token-optimizer.md +++ b/.github/workflows/agentic-token-optimizer.md @@ -36,7 +36,7 @@ steps: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | set -euo pipefail - mkdir -p /tmp/gh-aw/token-audit + mkdir -p /tmp/gh-aw/agent/token-audit echo "📥 Downloading agentic workflow logs (last 7 days)..." @@ -45,23 +45,23 @@ steps: --start-date -7d \ --json \ -c 50 \ - > /tmp/gh-aw/token-audit/all-runs.json || LOGS_EXIT=$? + > /tmp/gh-aw/agent/token-audit/all-runs.json || LOGS_EXIT=$? - if [ -s /tmp/gh-aw/token-audit/all-runs.json ]; then - TOTAL=$(jq '.runs | length' /tmp/gh-aw/token-audit/all-runs.json) + if [ -s /tmp/gh-aw/agent/token-audit/all-runs.json ]; then + TOTAL=$(jq '.runs | length' /tmp/gh-aw/agent/token-audit/all-runs.json) echo "✅ Downloaded $TOTAL agentic workflow runs (last 7 days)" if [ "$LOGS_EXIT" -ne 0 ]; then echo "⚠️ gh aw logs exited with code $LOGS_EXIT (partial results — likely API rate limit)" fi else echo "❌ No log data downloaded (exit code $LOGS_EXIT)" - echo '{"runs":[],"summary":{}}' > /tmp/gh-aw/token-audit/all-runs.json + echo '{"runs":[],"summary":{}}' > /tmp/gh-aw/agent/token-audit/all-runs.json fi - name: Aggregate top workflows by token usage run: | set -euo pipefail - mkdir -p /tmp/gh-aw/token-audit + mkdir -p /tmp/gh-aw/agent/token-audit jq '{ generated_at: (now | todateiso8601), @@ -91,10 +91,10 @@ steps: | reverse | .[:10] ) - }' /tmp/gh-aw/token-audit/all-runs.json > /tmp/gh-aw/token-audit/top-workflows.json + }' /tmp/gh-aw/agent/token-audit/all-runs.json > /tmp/gh-aw/agent/token-audit/top-workflows.json - echo "✅ Generated top workflow summary at /tmp/gh-aw/token-audit/top-workflows.json" - jq '.top_workflows' /tmp/gh-aw/token-audit/top-workflows.json + echo "✅ Generated top workflow summary at /tmp/gh-aw/agent/token-audit/top-workflows.json" + jq '.top_workflows' /tmp/gh-aw/agent/token-audit/top-workflows.json - name: Load optimization history run: | @@ -150,8 +150,8 @@ Prefer `--jq` on `gh api` calls over a separate `| jq` step when the filter is s ## Data Inputs -- `/tmp/gh-aw/token-audit/all-runs.json`: full 7-day run data (`gh aw logs --json`). -- `/tmp/gh-aw/token-audit/top-workflows.json`: pre-aggregated top 10 workflows by total tokens. +- `/tmp/gh-aw/agent/token-audit/all-runs.json`: full 7-day run data (`gh aw logs --json`). +- `/tmp/gh-aw/agent/token-audit/top-workflows.json`: pre-aggregated top 10 workflows by total tokens. - `/tmp/gh-aw/repo-memory/default/YYYY-MM-DD.json`: daily audit snapshots. - `/tmp/gh-aw/repo-memory/default/optimization-log.json`: prior optimizations (if present). diff --git a/.github/workflows/approach-validator.md b/.github/workflows/approach-validator.md index c216f516ccc..2a9a7dae877 100644 --- a/.github/workflows/approach-validator.md +++ b/.github/workflows/approach-validator.md @@ -90,7 +90,7 @@ Use GitHub tools to fetch the issue or PR, then incorporate any extra context fr After gathering the description, save it for reference: ```bash -mkdir -p /tmp/gh-aw/approach-validator +mkdir -p /tmp/gh-aw/agent/approach-validator ``` Store the approach title and description for use across all agents. @@ -113,7 +113,7 @@ For each failure mode, provide: Save the output: ```bash -cat > /tmp/gh-aw/approach-validator/agent1-devils-advocate.md << 'AGENT1_EOF' +cat > /tmp/gh-aw/agent/approach-validator/agent1-devils-advocate.md << 'AGENT1_EOF' [Agent 1 output goes here - write the actual analysis] AGENT1_EOF ``` @@ -127,7 +127,7 @@ AGENT1_EOF **Task**: Read the proposed approach AND the Devil's Advocate output from Agent 1. Research and present **2–3 alternative approaches**: ```bash -cat /tmp/gh-aw/approach-validator/agent1-devils-advocate.md +cat /tmp/gh-aw/agent/approach-validator/agent1-devils-advocate.md ``` For each alternative: @@ -142,7 +142,7 @@ Also provide a brief **comparative verdict**: Given the Devil's Advocate risks, Save the output: ```bash -cat > /tmp/gh-aw/approach-validator/agent2-alternatives-scout.md << 'AGENT2_EOF' +cat > /tmp/gh-aw/agent/approach-validator/agent2-alternatives-scout.md << 'AGENT2_EOF' [Agent 2 output goes here - write the actual analysis] AGENT2_EOF ``` @@ -156,8 +156,8 @@ AGENT2_EOF **Task**: Read all prior agent outputs, then assess the implementation complexity: ```bash -cat /tmp/gh-aw/approach-validator/agent1-devils-advocate.md -cat /tmp/gh-aw/approach-validator/agent2-alternatives-scout.md +cat /tmp/gh-aw/agent/approach-validator/agent1-devils-advocate.md +cat /tmp/gh-aw/agent/approach-validator/agent2-alternatives-scout.md ``` Provide: @@ -170,7 +170,7 @@ Provide: Save the output: ```bash -cat > /tmp/gh-aw/approach-validator/agent3-implementation-estimator.md << 'AGENT3_EOF' +cat > /tmp/gh-aw/agent/approach-validator/agent3-implementation-estimator.md << 'AGENT3_EOF' [Agent 3 output goes here - write the actual analysis] AGENT3_EOF ``` @@ -184,9 +184,9 @@ AGENT3_EOF **Task**: Read all prior outputs, then answer one question with maximum specificity: ```bash -cat /tmp/gh-aw/approach-validator/agent1-devils-advocate.md -cat /tmp/gh-aw/approach-validator/agent2-alternatives-scout.md -cat /tmp/gh-aw/approach-validator/agent3-implementation-estimator.md +cat /tmp/gh-aw/agent/approach-validator/agent1-devils-advocate.md +cat /tmp/gh-aw/agent/approach-validator/agent2-alternatives-scout.md +cat /tmp/gh-aw/agent/approach-validator/agent3-implementation-estimator.md ``` **The Dead End Question**: *Under what conditions would this approach require a full rewrite within 3 months of deployment?* @@ -202,7 +202,7 @@ Provide: Save the output: ```bash -cat > /tmp/gh-aw/approach-validator/agent4-dead-end-detector.md << 'AGENT4_EOF' +cat > /tmp/gh-aw/agent/approach-validator/agent4-dead-end-detector.md << 'AGENT4_EOF' [Agent 4 output goes here - write the actual analysis] AGENT4_EOF ``` @@ -216,10 +216,10 @@ Now synthesize all four agent outputs into a final report. Read all agent outputs: ```bash -cat /tmp/gh-aw/approach-validator/agent1-devils-advocate.md -cat /tmp/gh-aw/approach-validator/agent2-alternatives-scout.md -cat /tmp/gh-aw/approach-validator/agent3-implementation-estimator.md -cat /tmp/gh-aw/approach-validator/agent4-dead-end-detector.md +cat /tmp/gh-aw/agent/approach-validator/agent1-devils-advocate.md +cat /tmp/gh-aw/agent/approach-validator/agent2-alternatives-scout.md +cat /tmp/gh-aw/agent/approach-validator/agent3-implementation-estimator.md +cat /tmp/gh-aw/agent/approach-validator/agent4-dead-end-detector.md ``` Write the full compiled report to a file for artifact upload (using the run ID for uniqueness): diff --git a/.github/workflows/aw-failure-investigator.md b/.github/workflows/aw-failure-investigator.md index 772933e62ee..b65a0a373dd 100644 --- a/.github/workflows/aw-failure-investigator.md +++ b/.github/workflows/aw-failure-investigator.md @@ -17,7 +17,7 @@ tools: cache: - key: aw-failure-investigator-prefetch-${{ github.run_id }} name: Failure investigator prefetch - path: /tmp/gh-aw/failure-investigator + path: /tmp/gh-aw/agent/failure-investigator safe-outputs: create-issue: expires: 7d @@ -46,7 +46,7 @@ steps: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | set -euo pipefail - mkdir -p /tmp/gh-aw/failure-investigator + mkdir -p /tmp/gh-aw/agent/failure-investigator python3 - <<'PY' import json import os @@ -54,7 +54,7 @@ steps: from datetime import datetime, timezone REPO = os.environ["GITHUB_REPOSITORY"] - OUT = "/tmp/gh-aw/failure-investigator/prefetch.json" + OUT = "/tmp/gh-aw/agent/failure-investigator/prefetch.json" TRACKER_ID = "aw-failure-investigator" LOOKBACK = "-6h" MAX_FAILED_RUNS = 20 @@ -229,7 +229,7 @@ Investigate agentic workflow failures from the last 6 hours and produce actionab - **Repository**: `${{ github.repository }}` - **Lookback window**: last 6 hours - **Issue query to inspect first**: -- **Deterministic pre-fetch payload**: `/tmp/gh-aw/failure-investigator/prefetch.json` +- **Deterministic pre-fetch payload**: `/tmp/gh-aw/agent/failure-investigator/prefetch.json` ## Mission @@ -242,7 +242,7 @@ Investigate agentic workflow failures from the last 6 hours and produce actionab ### 0) Use deterministic pre-fetch payload first (required) -Read `/tmp/gh-aw/failure-investigator/prefetch.json` first. It already includes: +Read `/tmp/gh-aw/agent/failure-investigator/prefetch.json` first. It already includes: - recent failed run IDs for the 6-hour window - failed step names - truncated error logs (up to last 200 lines per failed job) diff --git a/.github/workflows/aw-portfolio-yield.md b/.github/workflows/aw-portfolio-yield.md index e3a98a2bd49..4791fa7ee87 100644 --- a/.github/workflows/aw-portfolio-yield.md +++ b/.github/workflows/aw-portfolio-yield.md @@ -37,7 +37,7 @@ pre-agent-steps: - name: Collect workflow telemetry snapshot uses: actions/github-script@v9 env: - AW_YIELD_TELEMETRY_OUT: /tmp/aw-yield-telemetry-summary.json + AW_YIELD_TELEMETRY_OUT: /tmp/gh-aw/agent/aw-yield-telemetry-summary.json with: script: | const fs = require("fs"); @@ -139,8 +139,8 @@ pre-agent-steps: env: AW_YIELD_WORKSPACE: ${{ github.workspace }} AW_YIELD_WORKFLOWS: .github/workflows - AW_YIELD_OUT: /tmp/aw-yield-precompute.json - AWY_OTEL_SUMMARY_JSON: /tmp/aw-yield-telemetry-summary.json + AW_YIELD_OUT: /tmp/gh-aw/agent/aw-yield-precompute.json + AWY_OTEL_SUMMARY_JSON: /tmp/gh-aw/agent/aw-yield-telemetry-summary.json with: script: | const path = require("path"); @@ -155,9 +155,9 @@ post-steps: uses: actions/github-script@v9 env: AW_YIELD_WORKSPACE: ${{ github.workspace }} - AW_YIELD_PRECOMPUTE: /tmp/aw-yield-precompute.json - AW_YIELD_AGENT_OUTPUT: /tmp/gh-aw - AW_YIELD_OUT: /tmp/aw-yield-final.json + AW_YIELD_PRECOMPUTE: /tmp/gh-aw/agent/aw-yield-precompute.json + AW_YIELD_AGENT_OUTPUT: /tmp/gh-aw/agent + AW_YIELD_OUT: /tmp/gh-aw/agent/aw-yield-final.json with: script: | const path = require("path"); @@ -175,7 +175,7 @@ You are the semantic interpreter for the repository's agentic workflow portfolio ## Hard Rules -- Treat `/tmp/aw-yield-precompute.json` as the factual source of truth. +- Treat `/tmp/gh-aw/agent/aw-yield-precompute.json` as the factual source of truth. - Telemetry = facts. Deterministic precompute/postcompute = math. Agent = interpretation. - Do **not** recompute raw scores, ranking, overlap values, fractions, or portfolio math from scratch. - Do **not** invent telemetry, economics, confidence, or success evidence. @@ -195,7 +195,7 @@ Explicitly evaluate these three levels: Read and rely on: -- `/tmp/aw-yield-precompute.json` +- `/tmp/gh-aw/agent/aw-yield-precompute.json` - workflow recommendation seeds already computed there - overlap clusters already computed there - organizational health signals already computed there @@ -203,7 +203,7 @@ Read and rely on: ## Deliverables -1. Write `/tmp/gh-aw/portfolio-yield-agent.json` with this shape: +1. Write `/tmp/gh-aw/agent/portfolio-yield-agent.json` with this shape: ```json { diff --git a/.github/workflows/ci-coach.md b/.github/workflows/ci-coach.md index aa1236c52c2..4ca68232cf5 100644 --- a/.github/workflows/ci-coach.md +++ b/.github/workflows/ci-coach.md @@ -71,29 +71,29 @@ Analyze the CI workflow daily to identify concrete optimization opportunities th The `ci-data-analysis` shared module has pre-downloaded CI run data and built the project. Available data: -1. **CI Runs**: `/tmp/ci-runs.json` - Last 60 workflow runs -2. **CI Summary**: `/tmp/ci-summary.json` - Pre-computed failure patterns, duration stats, and top opportunities -3. **Artifacts**: `/tmp/ci-artifacts/` - Coverage reports, benchmarks, and **fuzz test results** +1. **CI Runs**: `/tmp/gh-aw/agent/ci-runs.json` - Last 60 workflow runs +2. **CI Summary**: `/tmp/gh-aw/agent/ci-summary.json` - Pre-computed failure patterns, duration stats, and top opportunities +3. **Artifacts**: `/tmp/gh-aw/agent/ci-artifacts/` - Coverage reports, benchmarks, and **fuzz test results** 4. **CI Configuration**: - `.github/workflows/ci.yml` - `.github/workflows/cgo.yml` - `.github/workflows/cjs.yml` 5. **Cache Memory**: `/tmp/gh-aw/cache-memory/` - Historical analysis data -6. **Test Results**: `/tmp/gh-aw/test-results.json` - Test performance data -7. **Fuzz Results**: `/tmp/ci-artifacts/*/fuzz-results/` - Fuzz test output and corpus data +6. **Test Results**: `/tmp/gh-aw/agent/test-results.json` - Test performance data +7. **Fuzz Results**: `/tmp/gh-aw/agent/ci-artifacts/*/fuzz-results/` - Fuzz test output and corpus data The project has been **built, linted, and tested** so you can validate changes immediately. -Start from `/tmp/ci-summary.json` first and only read raw files if a summary metric needs verification. +Start from `/tmp/gh-aw/agent/ci-summary.json` first and only read raw files if a summary metric needs verification. {{#if experiments.prompt_style == "concise" }} ## Task -Analyze CI workflows (`.github/workflows/ci.yml`, `cgo.yml`, `cjs.yml`) using pre-downloaded data in `/tmp`. Identify the top 3 highest-impact optimizations for cost and speed. If you find actionable improvements, make focused changes, validate with `make lint && make build && make test-unit && make recompile`, and create a PR. If CI is healthy, call `noop`. Never modify test code to hide failures. +Analyze CI workflows (`.github/workflows/ci.yml`, `cgo.yml`, `cjs.yml`) using pre-downloaded data in `/tmp/gh-aw/agent` (plus cache-memory where noted). Identify the top 3 highest-impact optimizations for cost and speed. If you find actionable improvements, make focused changes, validate with `make lint && make build && make test-unit && make recompile`, and create a PR. If CI is healthy, call `noop`. Never modify test code to hide failures. **Data**: -- `/tmp/ci-summary.json` (start here) -- `/tmp/ci-runs.json` -- `/tmp/ci-artifacts/` +- `/tmp/gh-aw/agent/ci-summary.json` (start here) +- `/tmp/gh-aw/agent/ci-runs.json` +- `/tmp/gh-aw/agent/ci-artifacts/` - `/tmp/gh-aw/cache-memory/` **Required approach**: @@ -131,7 +131,7 @@ Follow the optimization strategies defined in the `ci-optimization-strategies` s - Check that the test suite FAILS when individual tests fail (not just reporting failures) - Review test job exit codes - ensure failed tests cause the job to exit with non-zero status - Validate that test result artifacts show actual test failures, not swallowed errors -- **Analyze fuzz test performance**: Review fuzz test results in `/tmp/ci-artifacts/*/fuzz-results/` +- **Analyze fuzz test performance**: Review fuzz test results in `/tmp/gh-aw/agent/ci-artifacts/*/fuzz-results/` - Check for new crash inputs or interesting corpus growth - Evaluate fuzz test duration (currently 10s per test) - Consider if fuzz time should be increased for security-critical tests @@ -235,7 +235,7 @@ Use this compact structure (h3 or lower headers only): - **Cap analysis depth**: Focus on the **top 3 highest-impact opportunities** only. Do not perform exhaustive investigation of every possible metric. - **Early exit on no-op**: If Phase 1 (CI job health) and Phase 2 (test coverage) show no issues, skip Phases 3–5 and call `noop` immediately. - **Concise PR descriptions**: Keep PR descriptions under 600 words. Use `
` tags for any extended examples or comparisons. -- **Reuse pre-downloaded data**: All data is already available under `/tmp`. Do not download anything twice or request data not referenced in the Data Available section. +- **Reuse pre-downloaded data**: All data is already available under `/tmp/gh-aw/agent` (plus cache-memory where noted). Do not download anything twice or request data not referenced in the Data Available section. - **Limit validation scope**: Run only `make lint && make build && make test-unit && make recompile`. Do not add extra validation steps. - **Stop after PR**: Once a PR is created (or `noop` is called), stop — do not generate additional commentary. diff --git a/.github/workflows/ci-doctor.md b/.github/workflows/ci-doctor.md index e177834c9d8..c0af6ec8156 100644 --- a/.github/workflows/ci-doctor.md +++ b/.github/workflows/ci-doctor.md @@ -57,9 +57,9 @@ steps: REPO: ${{ github.repository }} run: | set -e - LOG_DIR="/tmp/ci-doctor/logs" - ARTIFACT_DIR="/tmp/ci-doctor/artifacts" - FILTERED_DIR="/tmp/ci-doctor/filtered" + LOG_DIR="/tmp/gh-aw/agent/ci-doctor/logs" + ARTIFACT_DIR="/tmp/gh-aw/agent/ci-doctor/artifacts" + FILTERED_DIR="/tmp/gh-aw/agent/ci-doctor/filtered" mkdir -p "$LOG_DIR" "$ARTIFACT_DIR" "$FILTERED_DIR" echo "=== CI Doctor: Pre-downloading logs and artifacts for run $RUN_ID ===" @@ -122,7 +122,7 @@ steps: done # Write summary for the agent - SUMMARY_FILE="/tmp/ci-doctor/summary.txt" + SUMMARY_FILE="/tmp/gh-aw/agent/ci-doctor/summary.txt" { echo "=== CI Doctor Pre-Analysis ===" echo "Run ID: $RUN_ID" @@ -162,7 +162,7 @@ steps: REPO: ${{ github.repository }} run: | set -e - PR_DIR="/tmp/ci-doctor/pr" + PR_DIR="/tmp/gh-aw/agent/ci-doctor/pr" mkdir -p "$PR_DIR" echo "=== CI Doctor: Fetching check runs for PR #$PR_NUMBER (SHA: $HEAD_SHA) ===" @@ -231,15 +231,15 @@ You were invoked via the `ci-doctor` label on pull request #${{ github.event.pul Check run data was fetched before this session: -- **Summary**: `/tmp/ci-doctor/pr/summary.txt` — all check runs and their status -- **All checks**: `/tmp/ci-doctor/pr/check-runs.json` — full check run details -- **Failed checks**: `/tmp/ci-doctor/pr/failed-checks.json` — checks with failure/cancelled/timed_out conclusions +- **Summary**: `/tmp/gh-aw/agent/ci-doctor/pr/summary.txt` — all check runs and their status +- **All checks**: `/tmp/gh-aw/agent/ci-doctor/pr/check-runs.json` — full check run details +- **Failed checks**: `/tmp/gh-aw/agent/ci-doctor/pr/failed-checks.json` — checks with failure/cancelled/timed_out conclusions ### PR CI Doctor Protocol > **Available GitHub tools**: `list_workflow_jobs`, `get_check_runs`, `get_job_logs`, and other actions tools are provided via the configured GitHub toolsets (`default` + `actions`). -1. **Read** `/tmp/ci-doctor/pr/summary.txt` to understand the current check status. +1. **Read** `/tmp/gh-aw/agent/ci-doctor/pr/summary.txt` to understand the current check status. 2. **If no checks are failing**: call `noop` with the message "All PR checks are passing — no action needed." and stop. 3. **For each failing check**: a. Use `list_workflow_jobs` (or `get_check_runs`) to get the associated workflow run and job IDs. @@ -305,13 +305,13 @@ Check run data was fetched before this session: Logs and artifacts have been pre-downloaded before this session started: -- **Summary**: `/tmp/ci-doctor/summary.txt` — failed jobs, failed steps, all file locations, and pre-located error hints -- **Job metadata**: `/tmp/ci-doctor/logs/failed-jobs.json` — structured list of failed jobs and their failed steps -- **Log files**: `/tmp/ci-doctor/logs/job-.log` — full job logs downloaded from GitHub Actions -- **Artifact files**: `/tmp/ci-doctor/artifacts/` — all workflow run artifacts, unpacked by artifact name -- **Hint files**: `/tmp/ci-doctor/filtered/*-hints.txt` — pre-located error lines (from logs and artifacts) via generic grep heuristics +- **Summary**: `/tmp/gh-aw/agent/ci-doctor/summary.txt` — failed jobs, failed steps, all file locations, and pre-located error hints +- **Job metadata**: `/tmp/gh-aw/agent/ci-doctor/logs/failed-jobs.json` — structured list of failed jobs and their failed steps +- **Log files**: `/tmp/gh-aw/agent/ci-doctor/logs/job-.log` — full job logs downloaded from GitHub Actions +- **Artifact files**: `/tmp/gh-aw/agent/ci-doctor/artifacts/` — all workflow run artifacts, unpacked by artifact name +- **Hint files**: `/tmp/gh-aw/agent/ci-doctor/filtered/*-hints.txt` — pre-located error lines (from logs and artifacts) via generic grep heuristics -**Start here**: Read `/tmp/ci-doctor/summary.txt` first — it lists every file location and the first few hint matches. Then examine the relevant hint files to jump directly to error locations (read ±10 lines around each hinted line number before loading the full log or artifact). +**Start here**: Read `/tmp/gh-aw/agent/ci-doctor/summary.txt` first — it lists every file location and the first few hint matches. Then examine the relevant hint files to jump directly to error locations (read ±10 lines around each hinted line number before loading the full log or artifact). ## Investigation Protocol @@ -326,10 +326,10 @@ Logs and artifacts have been pre-downloaded before this session started: 4. **Quick Assessment**: Determine if this is a new type of failure or a recurring pattern ### Phase 2: Deep Log Analysis -1. **Use Pre-Downloaded Logs and Artifacts**: Use the files in `/tmp/ci-doctor/`: +1. **Use Pre-Downloaded Logs and Artifacts**: Use the files in `/tmp/gh-aw/agent/ci-doctor/`: - Read the summary and hint files first (minimal context load) - Read ±10 lines around each hinted line number in the full log or artifact file - - Check `/tmp/ci-doctor/artifacts/` for any structured output (test reports, coverage, etc.) + - Check `/tmp/gh-aw/agent/ci-doctor/artifacts/` for any structured output (test reports, coverage, etc.) - Only load the full log content if the hints are insufficient 2. **Fallback Log Retrieval**: If pre-downloaded files are unavailable, use `get_job_logs` with `failed_only=true`, `return_content=true`, and `tail_lines=100` to get the most relevant portion of logs directly (avoids downloading large blob files). Do NOT use `web-fetch` on blob storage log URLs. 3. **Pattern Recognition**: Analyze logs for: @@ -348,7 +348,7 @@ Logs and artifacts have been pre-downloaded before this session started: ### Phase 3: Historical Context Analysis 1. **Search Investigation History**: Use file-based storage to search for similar failures: - - Read from cached investigation files in `/tmp/memory/investigations/` + - Read from cached investigation files in `/tmp/gh-aw/agent/memory/investigations/` - Parse previous failure patterns and solutions - Look for recurring error signatures 2. **Issue History**: Search existing issues for related problems @@ -372,10 +372,10 @@ Logs and artifacts have been pre-downloaded before this session started: ### Phase 5: Pattern Storage and Knowledge Building 1. **Store Investigation**: Save structured investigation data to files: - - Write investigation report to `/tmp/memory/investigations/-.json` + - Write investigation report to `/tmp/gh-aw/agent/memory/investigations/-.json` - **Important**: Use filesystem-safe timestamp format `YYYY-MM-DD-HH-MM-SS-sss` (e.g., `2026-02-12-11-20-45-458`) - **Do NOT use** ISO 8601 format with colons (e.g., `2026-02-12T11:20:45.458Z`) - colons are not allowed in artifact filenames - - Store error patterns in `/tmp/memory/patterns/` + - Store error patterns in `/tmp/gh-aw/agent/memory/patterns/` - Maintain an index file of all investigations for fast searching 2. **Update Pattern Database**: Enhance knowledge with new findings by updating pattern files 3. **Save Artifacts**: Store detailed logs and analysis in the cached directories @@ -501,8 +501,8 @@ You **MUST** always end by calling exactly one of these safe output tools before ## Cache Usage Strategy -- Store investigation database and knowledge patterns in `/tmp/memory/investigations/` and `/tmp/memory/patterns/` -- Cache detailed log analysis and artifacts in `/tmp/investigation/logs/` and `/tmp/investigation/reports/` +- Store investigation database and knowledge patterns in `/tmp/gh-aw/agent/memory/investigations/` and `/tmp/gh-aw/agent/memory/patterns/` +- Cache detailed log analysis and artifacts in `/tmp/gh-aw/agent/investigation/logs/` and `/tmp/gh-aw/agent/investigation/reports/` - Persist findings across workflow runs using GitHub Actions cache - Build cumulative knowledge about failure patterns and solutions using structured JSON files - Use file-based indexing for fast pattern matching and similarity detection diff --git a/.github/workflows/cloclo.md b/.github/workflows/cloclo.md index 8e9b47e3180..a1b8d7dcdab 100644 --- a/.github/workflows/cloclo.md +++ b/.github/workflows/cloclo.md @@ -107,7 +107,7 @@ You have access to: 1. **Serena MCP**: Static analysis and code intelligence capabilities 2. **gh-aw MCP**: GitHub Agentic Workflows introspection and management 3. **Playwright**: Browser automation via CLI (`playwright-cli ` in bash) -4. **JQ Schema**: JSON structure discovery tool at `/tmp/gh-aw/jqschema.sh` +4. **JQ Schema**: JSON structure discovery tool at `/tmp/gh-aw/agent/jqschema.sh` 5. **Cache Memory**: Persistent memory storage at `/tmp/gh-aw/cache-memory/` for multi-step reasoning 6. **Edit Tool**: For file creation and modification 7. **Bash Tools**: Shell command execution with JQ support diff --git a/.github/workflows/copilot-agent-analysis.md b/.github/workflows/copilot-agent-analysis.md index 49e281c1764..6c6f6cef84c 100644 --- a/.github/workflows/copilot-agent-analysis.md +++ b/.github/workflows/copilot-agent-analysis.md @@ -59,20 +59,20 @@ Daily analysis of pull requests created by copilot-swe-agent in the last 24 hour ### Phase 1: Collect PR Data **Pre-fetched Data Available**: This workflow includes a preparation step that has already fetched Copilot PR data for the last 30 days using gh CLI. The data is available at: -- `/tmp/gh-aw/pr-data/copilot-prs.json` - Full PR data in JSON format -- `/tmp/gh-aw/pr-data/copilot-prs-schema.json` - Schema showing the structure +- `/tmp/gh-aw/agent/pr-data/copilot-prs.json` - Full PR data in JSON format +- `/tmp/gh-aw/agent/pr-data/copilot-prs-schema.json` - Schema showing the structure You can use `jq` to process this data directly. For example: ```bash # Get PRs from the last 24 hours TODAY="$(date -d '24 hours ago' '+%Y-%m-%dT%H:%M:%SZ' 2>/dev/null || date -v-24H '+%Y-%m-%dT%H:%M:%SZ')" -jq --arg today "$TODAY" '[.[] | select(.createdAt >= $today)]' /tmp/gh-aw/pr-data/copilot-prs.json +jq --arg today "$TODAY" '[.[] | select(.createdAt >= $today)]' /tmp/gh-aw/agent/pr-data/copilot-prs.json # Count total PRs -jq 'length' /tmp/gh-aw/pr-data/copilot-prs.json +jq 'length' /tmp/gh-aw/agent/pr-data/copilot-prs.json # Get PR numbers for the last 24 hours -jq --arg today "$TODAY" '[.[] | select(.createdAt >= $today) | .number]' /tmp/gh-aw/pr-data/copilot-prs.json +jq --arg today "$TODAY" '[.[] | select(.createdAt >= $today) | .number]' /tmp/gh-aw/agent/pr-data/copilot-prs.json ``` **Alternative Approaches** (if you need additional data not in the pre-fetched file): diff --git a/.github/workflows/copilot-opt.md b/.github/workflows/copilot-opt.md index 2e115206262..2638b4fb44f 100644 --- a/.github/workflows/copilot-opt.md +++ b/.github/workflows/copilot-opt.md @@ -61,13 +61,13 @@ Analyze Copilot session logs from the **last 14 days** to detect inefficiencies, Pre-fetched data is available from shared imports: -- `/tmp/gh-aw/session-data/sessions-list.json` -- `/tmp/gh-aw/session-data/logs/` (conversation logs and/or fallback logs) -- `/tmp/gh-aw/pr-data/copilot-prs.json` (cross-analysis source — always present) +- `/tmp/gh-aw/agent/session-data/sessions-list.json` +- `/tmp/gh-aw/agent/session-data/logs/` (conversation logs and/or fallback logs) +- `/tmp/gh-aw/agent/pr-data/copilot-prs.json` (cross-analysis source — always present) These paths are populated by imported setup components: -- `shared/copilot-session-data-fetch.md` writes the session files under `/tmp/gh-aw/session-data/` -- `shared/copilot-pr-data-fetch.md` writes PR data under `/tmp/gh-aw/pr-data/` +- `shared/copilot-session-data-fetch.md` writes the session files under `/tmp/gh-aw/agent/session-data/` +- `shared/copilot-pr-data-fetch.md` writes PR data under `/tmp/gh-aw/agent/pr-data/` ## Hard Requirements @@ -81,7 +81,7 @@ These paths are populated by imported setup components: - large initial instruction/context payload - inefficient orchestration/model-loading patterns - prompt drift / instruction adherence degradation -4. **Always** correlate findings with Copilot PR patterns from `/tmp/gh-aw/pr-data/copilot-prs.json`. +4. **Always** correlate findings with Copilot PR patterns from `/tmp/gh-aw/agent/pr-data/copilot-prs.json`. 5. **Always** perform duplicate PR pattern detection (see Phase 3) and surface retry-blocked topics. 6. Generate **exactly three** recommendations: - each recommendation must target a distinct root cause @@ -94,7 +94,7 @@ If data is incomplete, proceed with available evidence and clearly state data qu ## Phase 0 — Setup 1. Confirm required files exist. -2. Enumerate session logs under `/tmp/gh-aw/session-data/logs`. +2. Enumerate session logs under `/tmp/gh-aw/agent/session-data/logs`. 3. Restrict analysis scope to sessions with `created_at` in the last 14 days. Use UTC for all time filtering. @@ -134,7 +134,7 @@ Aggregate across all sessions to identify recurring systemic patterns. ## Phase 3 — PR Cross-Analysis and Duplicate Pattern Detection -This phase is **mandatory**. `/tmp/gh-aw/pr-data/copilot-prs.json` is always present from the imported `shared/copilot-pr-data-fetch.md` step. +This phase is **mandatory**. `/tmp/gh-aw/agent/pr-data/copilot-prs.json` is always present from the imported `shared/copilot-pr-data-fetch.md` step. ### 3a — General PR Failure Signals @@ -154,7 +154,7 @@ jq '[.[] | select(.state == "CLOSED" and .mergedAt == null)] | group_by(.title) | map({title: .[0].title, count: length, prs: [.[] | {number, url, closedAt}]}) | map(select(.count >= 2)) - | sort_by(-.count)' /tmp/gh-aw/pr-data/copilot-prs.json + | sort_by(-.count)' /tmp/gh-aw/agent/pr-data/copilot-prs.json ``` For each topic with **two or more** closed-without-merge PRs (retry-blocked topics): diff --git a/.github/workflows/copilot-pr-merged-report.md b/.github/workflows/copilot-pr-merged-report.md index 63d22cfc289..6218b327ba6 100644 --- a/.github/workflows/copilot-pr-merged-report.md +++ b/.github/workflows/copilot-pr-merged-report.md @@ -66,9 +66,9 @@ Analyze merged Copilot pull requests from the last 24 hours and generate a basic **Step 1.1: Filter Merged PRs from Pre-Fetched Data** -Use the pre-fetched PR dataset at `/tmp/gh-aw/pr-data/copilot-prs.json` and filter by `mergedAt` in the last 24 hours: +Use the pre-fetched PR dataset at `/tmp/gh-aw/agent/pr-data/copilot-prs.json` and filter by `mergedAt` in the last 24 hours: ```bash -jq '[.[] | select(.mergedAt != null and (.mergedAt | fromdateiso8601) >= (now - 86400))]' /tmp/gh-aw/pr-data/copilot-prs.json +jq '[.[] | select(.mergedAt != null and (.mergedAt | fromdateiso8601) >= (now - 86400))]' /tmp/gh-aw/agent/pr-data/copilot-prs.json ``` This filter: @@ -92,7 +92,7 @@ Save this data for further analysis. For each merged PR found in Phase 1: - **Important**: Build the filtered merged PR list first, then iterate only that filtered list. -- **Do not** call `pr view` for every PR in `/tmp/gh-aw/pr-data/copilot-prs.json`. +- **Do not** call `pr view` for every PR in `/tmp/gh-aw/agent/pr-data/copilot-prs.json`. **Step 2.1: Get PR Files** diff --git a/.github/workflows/copilot-pr-nlp-analysis.md b/.github/workflows/copilot-pr-nlp-analysis.md index 8c39194726e..382776b7ffe 100644 --- a/.github/workflows/copilot-pr-nlp-analysis.md +++ b/.github/workflows/copilot-pr-nlp-analysis.md @@ -46,21 +46,21 @@ steps: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | # Create comments directory - mkdir -p /tmp/gh-aw/pr-comments + mkdir -p /tmp/gh-aw/agent/pr-comments # Fetch detailed comments for each PR from the pre-fetched data - PR_COUNT=$(jq 'length' /tmp/gh-aw/pr-data/copilot-prs.json) + PR_COUNT=$(jq 'length' /tmp/gh-aw/agent/pr-data/copilot-prs.json) echo "Fetching comments for $PR_COUNT PRs..." - jq -r '.[].number' /tmp/gh-aw/pr-data/copilot-prs.json | while read -r PR_NUM; do + jq -r '.[].number' /tmp/gh-aw/agent/pr-data/copilot-prs.json | while read -r PR_NUM; do echo "Fetching comments for PR #${PR_NUM}" gh pr view "${PR_NUM}" \ --json comments,reviews,reviewComments \ - > "/tmp/gh-aw/pr-comments/pr-${PR_NUM}.json" 2>/dev/null || echo "{}" > "/tmp/gh-aw/pr-comments/pr-${PR_NUM}.json" + > "/tmp/gh-aw/agent/pr-comments/pr-${PR_NUM}.json" 2>/dev/null || echo "{}" > "/tmp/gh-aw/agent/pr-comments/pr-${PR_NUM}.json" sleep 0.5 # Rate limiting done - echo "Comment data saved to /tmp/gh-aw/pr-comments/" + echo "Comment data saved to /tmp/gh-aw/agent/pr-comments/" timeout-minutes: 20 @@ -84,8 +84,8 @@ Generate a daily NLP-based analysis report of Copilot-created PRs merged within - **Repository**: ${{ github.repository }} - **Analysis Period**: Last 24 hours (merged PRs only) - **Data Location**: - - PR metadata: `/tmp/gh-aw/pr-data/copilot-prs.json` - - PR comments: `/tmp/gh-aw/pr-comments/pr-*.json` + - PR metadata: `/tmp/gh-aw/agent/pr-data/copilot-prs.json` + - PR comments: `/tmp/gh-aw/agent/pr-comments/pr-*.json` - **Python Environment**: NumPy, Pandas, Matplotlib, Seaborn, SciPy, NLTK, scikit-learn, TextBlob, WordCloud - **Output Directory**: `/tmp/gh-aw/python/charts/` @@ -94,31 +94,31 @@ Generate a daily NLP-based analysis report of Copilot-created PRs merged within - Python analysis dependencies are already installed by pre-agent workflow steps. - **Do NOT run any `pip install` commands in agent turns.** - If an import unexpectedly fails, report the missing package in the output and continue with reduced analysis instead of installing dependencies in agent turns. -- Run Python scripts with `/tmp/gh-aw/venv/bin/python3` to use the preinstalled environment. +- Run Python scripts with `/tmp/gh-aw/agent/venv/bin/python3` to use the preinstalled environment. ## Task Overview ### Phase 1: Load and Parse PR Conversation Data **Pre-fetched Data Available**: The shared component has downloaded all Copilot PRs from the last 30 days. The data is available at: -- `/tmp/gh-aw/pr-data/copilot-prs.json` - Full PR data in JSON format -- `/tmp/gh-aw/pr-data/copilot-prs-schema.json` - Schema showing the structure +- `/tmp/gh-aw/agent/pr-data/copilot-prs.json` - Full PR data in JSON format +- `/tmp/gh-aw/agent/pr-data/copilot-prs-schema.json` - Schema showing the structure **Note**: This workflow focuses on merged PRs from the last 24 hours. Use jq to filter: ```bash # Get PRs merged in the last 24 hours DATE_24H_AGO=$(date -d '1 day ago' '+%Y-%m-%dT%H:%M:%SZ' 2>/dev/null || date -v-1d '+%Y-%m-%dT%H:%M:%SZ') -jq --arg date "$DATE_24H_AGO" '[.[] | select(.mergedAt != null and .mergedAt >= $date)]' /tmp/gh-aw/pr-data/copilot-prs.json +jq --arg date "$DATE_24H_AGO" '[.[] | select(.mergedAt != null and .mergedAt >= $date)]' /tmp/gh-aw/agent/pr-data/copilot-prs.json ``` 1. **Load PR metadata**: ```bash - cat /tmp/gh-aw/pr-data/copilot-prs.json - echo "Total PRs: $(jq 'length' /tmp/gh-aw/pr-data/copilot-prs.json)" + cat /tmp/gh-aw/agent/pr-data/copilot-prs.json + echo "Total PRs: $(jq 'length' /tmp/gh-aw/agent/pr-data/copilot-prs.json)" ``` 2. **Parse conversation threads** using `jq`: - - For each PR in `/tmp/gh-aw/pr-comments/pr-*.json`, extract: + - For each PR in `/tmp/gh-aw/agent/pr-comments/pr-*.json`, extract: - Comments (from `comments` array) - Review comments (from `reviewComments` array) - Reviews (from `reviews` array) @@ -141,7 +141,7 @@ jq --arg date "$DATE_24H_AGO" '[.[] | select(.mergedAt != null and .mergedAt >= 1. **Use jq to extract conversation threads**: ```bash # Example: Extract all comment bodies from a PR - jq '.comments[].body' /tmp/gh-aw/pr-comments/pr-123.json + jq '.comments[].body' /tmp/gh-aw/agent/pr-comments/pr-123.json ``` 2. **Create Python script** (`/tmp/gh-aw/python/parse_conversations.py`) to: diff --git a/.github/workflows/copilot-pr-prompt-analysis.md b/.github/workflows/copilot-pr-prompt-analysis.md index c2ca68c7515..bfdcfd0a88d 100644 --- a/.github/workflows/copilot-pr-prompt-analysis.md +++ b/.github/workflows/copilot-pr-prompt-analysis.md @@ -57,7 +57,7 @@ Generate a daily report analyzing Copilot-generated PRs from the last 30 days, f - **Repository**: ${{ github.repository }} - **Analysis Period**: Last 30 days -- **Data Location**: Pre-fetched PR data is available at `/tmp/gh-aw/pr-data/copilot-prs.json` +- **Data Location**: Pre-fetched PR data is available at `/tmp/gh-aw/agent/pr-data/copilot-prs.json` ## Task Overview @@ -67,12 +67,12 @@ Generate a daily report analyzing Copilot-generated PRs from the last 30 days, f 1. **Load the data**: ```bash - cat /tmp/gh-aw/pr-data/copilot-prs.json + cat /tmp/gh-aw/agent/pr-data/copilot-prs.json ``` 2. **Verify data**: ```bash - echo "Total PRs loaded: $(jq 'length' /tmp/gh-aw/pr-data/copilot-prs.json)" + echo "Total PRs loaded: $(jq 'length' /tmp/gh-aw/agent/pr-data/copilot-prs.json)" ``` ### Phase 2: Extract and Categorize Prompts diff --git a/.github/workflows/copilot-session-insights.md b/.github/workflows/copilot-session-insights.md index 036b7f3d9ee..2a642c4bcd5 100644 --- a/.github/workflows/copilot-session-insights.md +++ b/.github/workflows/copilot-session-insights.md @@ -30,8 +30,8 @@ tools: toolsets: [default] bash: - "jq *" - - "find /tmp -type f" - - "cat /tmp/*" + - "find /tmp/gh-aw/agent -type f" + - "cat /tmp/gh-aw/agent/*" - "mkdir -p *" - "find * -maxdepth 1" - "date *" @@ -77,7 +77,7 @@ Create a comprehensive report and publish it as a GitHub Discussion for team rev - **Repository**: ${{ github.repository }} - **Analysis Period**: Most recent ~50 agent sessions - **Cache Memory**: `/tmp/gh-aw/cache-memory/` -- **Pre-fetched Data**: Available at `/tmp/gh-aw/session-data/` +- **Pre-fetched Data**: Available at `/tmp/gh-aw/agent/session-data/` - **Conversation Logs**: Now available with agent's internal monologue and reasoning ## Task Overview @@ -85,8 +85,8 @@ Create a comprehensive report and publish it as a GitHub Discussion for team rev ### Phase 0: Setup and Prerequisites **Pre-fetched Data Available**: Session data has been fetched by the `copilot-session-data-fetch` shared module: -- `/tmp/gh-aw/session-data/sessions-list.json` - List of sessions with metadata -- `/tmp/gh-aw/session-data/logs/` - **Conversation transcript files** (new!) +- `/tmp/gh-aw/agent/session-data/sessions-list.json` - List of sessions with metadata +- `/tmp/gh-aw/agent/session-data/logs/` - **Conversation transcript files** (new!) - `{session_number}-conversation.txt` - Agent's internal monologue, reasoning, and tool usage - `{session_number}/` - GitHub Actions logs (fallback only) @@ -105,7 +105,7 @@ Create a comprehensive report and publish it as a GitHub Discussion for team rev ### Phase 1: Session Analysis -For each downloaded session in `/tmp/gh-aw/session-data/`: +For each downloaded session in `/tmp/gh-aw/agent/session-data/`: 1. **Load Conversation Logs**: Read the agent's conversation transcript from `{session_number}-conversation.txt` files. These contain: - Agent's internal reasoning and planning @@ -150,7 +150,7 @@ gh api "repos/$GITHUB_REPOSITORY/pulls?state=open&per_page=100" \ --paginate \ --jq '.[] | {number, title, head_branch: .head.ref, created_at, updated_at, assignees: [.assignees[].login], requested_reviewers: [.requested_reviewers[].login]}' \ | jq -s '.' \ - > /tmp/gh-aw/session-data/open-prs.json + > /tmp/gh-aw/agent/session-data/open-prs.json # Fetch in-progress workflow runs from the last 6 hours (paginated) SIX_HOURS_AGO=$(date -d '6 hours ago' '+%Y-%m-%dT%H:%M:%SZ' 2>/dev/null || date -v-6H '+%Y-%m-%dT%H:%M:%SZ') @@ -158,10 +158,10 @@ gh api "repos/$GITHUB_REPOSITORY/actions/runs?status=in_progress&per_page=100" \ --paginate \ --jq ".workflow_runs[] | select(.created_at >= \"${SIX_HOURS_AGO}\") | {run_id: .id, branch: .head_branch, workflow_name: .name, created_at, status}" \ | jq -s '.' \ - > /tmp/gh-aw/session-data/active-runs.json + > /tmp/gh-aw/agent/session-data/active-runs.json -echo "Fetched $(jq 'length' /tmp/gh-aw/session-data/open-prs.json) open PRs" -echo "Fetched $(jq 'length' /tmp/gh-aw/session-data/active-runs.json) in-progress runs" +echo "Fetched $(jq 'length' /tmp/gh-aw/agent/session-data/open-prs.json) open PRs" +echo "Fetched $(jq 'length' /tmp/gh-aw/agent/session-data/active-runs.json) in-progress runs" ``` **Orphan Detection Logic**: @@ -178,8 +178,8 @@ ONE_HOUR_AGO=$(date -d '1 hour ago' '+%Y-%m-%dT%H:%M:%SZ' 2>/dev/null || date -v # 3. Filter: gate_count >= 5, no copilot agent assigned, created_at < two_hours_ago # 4. Classify severity and emit escalation records jq -n \ - --slurpfile prs /tmp/gh-aw/session-data/open-prs.json \ - --slurpfile runs /tmp/gh-aw/session-data/active-runs.json \ + --slurpfile prs /tmp/gh-aw/agent/session-data/open-prs.json \ + --slurpfile runs /tmp/gh-aw/agent/session-data/active-runs.json \ --arg two_hours_ago "$TWO_HOURS_AGO" \ --arg one_hour_ago "$ONE_HOUR_AGO" ' # Build a map of branch -> gate_count from in-progress runs @@ -221,10 +221,10 @@ jq -n \ else "priority agent assignment" end) } ) | sort_by(-.gate_count) -' > /tmp/gh-aw/session-data/orphan-escalations.json +' > /tmp/gh-aw/agent/session-data/orphan-escalations.json -echo "Escalation candidates found: $(jq 'length' /tmp/gh-aw/session-data/orphan-escalations.json)" -jq '.' /tmp/gh-aw/session-data/orphan-escalations.json +echo "Escalation candidates found: $(jq 'length' /tmp/gh-aw/agent/session-data/orphan-escalations.json)" +jq '.' /tmp/gh-aw/agent/session-data/orphan-escalations.json ``` Use this data to populate the **Orphaned Branch Escalation Alerts** section in the report. @@ -482,13 +482,13 @@ _Workflow: ${{ github.workflow }}_ **Accessing Logs**: ```bash # List available conversation logs -find /tmp/gh-aw/session-data/logs -type f -name "*-conversation.txt" +find /tmp/gh-aw/agent/session-data/logs -type f -name "*-conversation.txt" # Read a specific conversation log -cat /tmp/gh-aw/session-data/logs/123-conversation.txt +cat /tmp/gh-aw/agent/session-data/logs/123-conversation.txt # Count conversation logs -find /tmp/gh-aw/session-data/logs -type f -name "*-conversation.txt" | wc -l +find /tmp/gh-aw/agent/session-data/logs -type f -name "*-conversation.txt" | wc -l ``` **What to Look For in Conversation Logs**: diff --git a/.github/workflows/daily-agentrx-trace-optimizer.md b/.github/workflows/daily-agentrx-trace-optimizer.md index ed85da3f450..29f31fc319a 100644 --- a/.github/workflows/daily-agentrx-trace-optimizer.md +++ b/.github/workflows/daily-agentrx-trace-optimizer.md @@ -55,10 +55,10 @@ Focus on: - Use `logs` to download parsed logs for recent runs. - Use `audit` for selected failing or high-latency runs. 2. Use only MCP-downloaded run data and logs as the telemetry source, prioritizing `runs[]` session fields over OTEL spans. -3. Use Python in `/tmp/agentrx` to avoid polluting the repository. +3. Use Python in `/tmp/gh-aw/agent/agentrx` to avoid polluting the repository. 4. Install AgentRx from GitHub: - - `python -m venv /tmp/agentrx/.venv` - - `source /tmp/agentrx/.venv/bin/activate` + - `python -m venv /tmp/gh-aw/agent/agentrx/.venv` + - `source /tmp/gh-aw/agent/agentrx/.venv/bin/activate` - `pip install --upgrade pip` - `pip install git+https://github.com/microsoft/AgentRx.git` @@ -68,13 +68,13 @@ Focus on: Invoke `trajectory-builder` by passing this exact input block: ```text -run_data_path: /tmp/agentrx/mcp-runs.json +run_data_path: /tmp/gh-aw/agent/agentrx/mcp-runs.json ``` -It must produce `/tmp/agentrx/trajectory.json`. +It must produce `/tmp/gh-aw/agent/agentrx/trajectory.json`. ### 2) Run AgentRx pipeline -Run the pipeline in stages and preserve outputs under `/tmp/agentrx/runs//`: +Run the pipeline in stages and preserve outputs under `/tmp/gh-aw/agent/agentrx/runs//`: - `ir`: normalize raw session run records into trajectory IR - `static` / `dynamic`: generate invariants used for diagnosis @@ -83,12 +83,12 @@ Run the pipeline in stages and preserve outputs under `/tmp/agentrx/runs/` -Read the file at `run_data_path` and create `/tmp/agentrx/trajectory.json`. +Read the file at `run_data_path` and create `/tmp/gh-aw/agent/agentrx/trajectory.json`. Use the last 24h of data and prioritize failed or high-latency runs. Map `runs[]` session records to ordered workflow steps. Include when present: step index, `github.workflow_ref`, `github.run_id`, status/error signal, `duration`, `effective_tokens`, `estimated_cost`, `turns`, `agentic_assessments`, `behavior_fingerprint`, `missing_tool_count`. -Output valid JSON only and write it to `/tmp/agentrx/trajectory.json`. +Output valid JSON only and write it to `/tmp/gh-aw/agent/agentrx/trajectory.json`. ## agent: `artifacts-summarizer` --- diff --git a/.github/workflows/daily-astrostylelite-markdown-spellcheck.md b/.github/workflows/daily-astrostylelite-markdown-spellcheck.md index e4247d57eb6..600f30485ff 100644 --- a/.github/workflows/daily-astrostylelite-markdown-spellcheck.md +++ b/.github/workflows/daily-astrostylelite-markdown-spellcheck.md @@ -45,7 +45,7 @@ jobs: run: | set -euo pipefail - ARTIFACT_DIR="/tmp/gh-aw/spellcheck" + ARTIFACT_DIR="/tmp/gh-aw/agent/spellcheck" mkdir -p "$ARTIFACT_DIR" find "$GITHUB_WORKSPACE/docs/src/content" -type f \( -name '*.md' -o -name '*.mdx' \) | sort > "$ARTIFACT_DIR/files.txt" @@ -192,7 +192,7 @@ jobs: if: success() shell: bash run: | - ARTIFACT_DIR="/tmp/gh-aw/spellcheck" + ARTIFACT_DIR="/tmp/gh-aw/agent/spellcheck" FINDINGS_COUNT=$(jq -r '.findings' "$ARTIFACT_DIR/summary.json") FILES_CHECKED=$(jq -r '.files_checked' "$ARTIFACT_DIR/summary.json") DICT_PATH=$(jq -r '.dictionary.path // "none"' "$ARTIFACT_DIR/summary.json") @@ -226,12 +226,12 @@ jobs: with: name: spellcheck-results path: | - /tmp/gh-aw/spellcheck/summary.json - /tmp/gh-aw/spellcheck/cspell-results.json - /tmp/gh-aw/spellcheck/cspell.stderr.log - /tmp/gh-aw/spellcheck/cspell-runtime-config.json - /tmp/gh-aw/spellcheck/findings.ndjson - /tmp/gh-aw/spellcheck/files.txt + /tmp/gh-aw/agent/spellcheck/summary.json + /tmp/gh-aw/agent/spellcheck/cspell-results.json + /tmp/gh-aw/agent/spellcheck/cspell.stderr.log + /tmp/gh-aw/agent/spellcheck/cspell-runtime-config.json + /tmp/gh-aw/agent/spellcheck/findings.ndjson + /tmp/gh-aw/agent/spellcheck/files.txt docs/.cspell.docs.json if-no-files-found: error retention-days: 3 @@ -253,7 +253,7 @@ steps: uses: actions/download-artifact@v8.0.1 with: name: spellcheck-results - path: /tmp/gh-aw/spellcheck + path: /tmp/gh-aw/agent/spellcheck tools: cli-proxy: true @@ -295,10 +295,10 @@ You maintain spelling quality for AstroStyleLite documentation under `docs/src/c The spellcheck job runs after activation and before the agent job, and stores machine-readable results at: -- `/tmp/gh-aw/spellcheck/summary.json` -- `/tmp/gh-aw/spellcheck/cspell-results.json` -- `/tmp/gh-aw/spellcheck/findings.ndjson` -- `/tmp/gh-aw/spellcheck/files.txt` +- `/tmp/gh-aw/agent/spellcheck/summary.json` +- `/tmp/gh-aw/agent/spellcheck/cspell-results.json` +- `/tmp/gh-aw/agent/spellcheck/findings.ndjson` +- `/tmp/gh-aw/agent/spellcheck/files.txt` - `docs/.cspell.docs.json` Dictionary source files referenced by `docs/.cspell.docs.json` are optional: @@ -325,13 +325,13 @@ When no findings exist, the workflow stops after spellcheck and skips agent exec {{#if experiments.prompt_style == "concise"}} Fix spelling errors in `docs/src/content/` markdown files. -Inputs: `/tmp/gh-aw/spellcheck/findings.ndjson` and `summary.json`. +Inputs: `/tmp/gh-aw/agent/spellcheck/findings.ndjson` and `summary.json`. Preserve technical terms, product names, and code symbols. Branch: `spellcheck/YYYY-MM-DD`. Call `noop` if no safe fixes exist. {{#else}} ## Task -1. Read `/tmp/gh-aw/spellcheck/summary.json` and `/tmp/gh-aw/spellcheck/findings.ndjson`. +1. Read `/tmp/gh-aw/agent/spellcheck/summary.json` and `/tmp/gh-aw/agent/spellcheck/findings.ndjson`. 2. Apply only justified spelling fixes in `docs/src/content/**/*.md` and `docs/src/content/**/*.mdx`. 3. Preserve technical terms, product names, code symbols, and intentional capitalization. 4. Do not re-run spellcheck in the agent job; use the provided artifact as the source of truth. diff --git a/.github/workflows/daily-aw-cross-repo-compile-check.md b/.github/workflows/daily-aw-cross-repo-compile-check.md index 3b7a547ebe1..69fa5112148 100644 --- a/.github/workflows/daily-aw-cross-repo-compile-check.md +++ b/.github/workflows/daily-aw-cross-repo-compile-check.md @@ -68,7 +68,7 @@ Every run must: ## Run Context - Cache root: `/tmp/gh-aw/cache-memory/aw-compat` -- Work root: `/tmp/gh-aw/aw-compat-work` +- Work root: `/tmp/gh-aw/agent/aw-compat-work` - Use filesystem-safe timestamps only: `YYYY-MM-DD-HH-MM-SS-sss` (no colons). ## Phase 0: Prepare Workspace and Build Latest gh-aw @@ -79,7 +79,7 @@ set -euo pipefail RUN_TS="$(date -u +%Y-%m-%d-%H-%M-%S)-$(date -u +%3N)" CACHE_ROOT="/tmp/gh-aw/cache-memory/aw-compat" RUN_DIR="$CACHE_ROOT/runs/$RUN_TS" -WORK_ROOT="/tmp/gh-aw/aw-compat-work/$RUN_TS" +WORK_ROOT="/tmp/gh-aw/agent/aw-compat-work/$RUN_TS" mkdir -p "$RUN_DIR" "$WORK_ROOT" "$CACHE_ROOT/index" diff --git a/.github/workflows/daily-cli-performance.md b/.github/workflows/daily-cli-performance.md index eac0fb8f4cb..f75cbd8c93d 100644 --- a/.github/workflows/daily-cli-performance.md +++ b/.github/workflows/daily-cli-performance.md @@ -104,7 +104,7 @@ Run the benchmark suite and capture results using **bash** (not mcpscripts — t **Step 1**: Create directory for results ```bash -mkdir -p /tmp/gh-aw/benchmarks +mkdir -p /tmp/gh-aw/agent/benchmarks ``` **Step 2**: Run benchmarks using bash @@ -124,10 +124,10 @@ The targeted benchmarks include: ```bash # Copy benchmark results to our directory -cp bench_performance.txt /tmp/gh-aw/benchmarks/bench_results.txt +cp bench_performance.txt /tmp/gh-aw/agent/benchmarks/bench_results.txt # Extract just the summary -grep "Benchmark" /tmp/gh-aw/benchmarks/bench_results.txt > /tmp/gh-aw/benchmarks/bench_summary.txt || true +grep "Benchmark" /tmp/gh-aw/agent/benchmarks/bench_results.txt > /tmp/gh-aw/agent/benchmarks/bench_summary.txt || true ``` **Expected benchmarks**: @@ -145,11 +145,11 @@ Parse the benchmark output and extract key metrics: ```bash # Extract benchmark results using awk -cat > /tmp/gh-aw/benchmarks/parse_results.sh << 'EOF' +cat > /tmp/gh-aw/agent/benchmarks/parse_results.sh << 'EOF' #!/bin/bash # Parse Go benchmark output and create JSON -results_file="/tmp/gh-aw/benchmarks/bench_results.txt" -output_file="/tmp/gh-aw/benchmarks/current_metrics.json" +results_file="/tmp/gh-aw/agent/benchmarks/bench_results.txt" +output_file="/tmp/gh-aw/agent/benchmarks/current_metrics.json" # Initialize JSON echo "{" > "$output_file" @@ -197,8 +197,8 @@ echo "Parsed benchmark results to $output_file" cat "$output_file" EOF -chmod +x /tmp/gh-aw/benchmarks/parse_results.sh -/tmp/gh-aw/benchmarks/parse_results.sh +chmod +x /tmp/gh-aw/agent/benchmarks/parse_results.sh +/tmp/gh-aw/agent/benchmarks/parse_results.sh ``` ## Phase 2: Load Historical Data @@ -232,7 +232,7 @@ fi # Append current results to history { - cat /tmp/gh-aw/benchmarks/current_metrics.json + cat /tmp/gh-aw/agent/benchmarks/current_metrics.json echo "" } >> "$HISTORY_FILE" @@ -246,7 +246,7 @@ echo "Historical data updated ($(wc -l < "$HISTORY_FILE" | tr -d ' ') entries)" Analyze trends and detect regressions: ```bash -cat > /tmp/gh-aw/benchmarks/analyze_trends.py << 'EOF' +cat > /tmp/gh-aw/agent/benchmarks/analyze_trends.py << 'EOF' #!/usr/bin/env python3 """ Analyze benchmark trends and detect performance regressions @@ -258,8 +258,8 @@ from pathlib import Path # Configuration HISTORY_FILE = '/tmp/gh-aw/repo-memory/default/benchmark_history.jsonl' -CURRENT_FILE = '/tmp/gh-aw/benchmarks/current_metrics.json' -OUTPUT_FILE = '/tmp/gh-aw/benchmarks/analysis.json' +CURRENT_FILE = '/tmp/gh-aw/agent/benchmarks/current_metrics.json' +OUTPUT_FILE = '/tmp/gh-aw/agent/benchmarks/analysis.json' # Bounded context window — must match MAX_HISTORY_ENTRIES in the bash pruning step MAX_HISTORY_ENTRIES = 14 @@ -379,8 +379,8 @@ if __name__ == '__main__': main() EOF -chmod +x /tmp/gh-aw/benchmarks/analyze_trends.py -python3 /tmp/gh-aw/benchmarks/analyze_trends.py +chmod +x /tmp/gh-aw/agent/benchmarks/analyze_trends.py +python3 /tmp/gh-aw/agent/benchmarks/analyze_trends.py ``` ## Phase 4: Open Issues for Regressions @@ -392,7 +392,7 @@ Review the analysis and determine if issues should be opened: ```bash # Display analysis summary echo "=== Performance Analysis Summary ===" -cat /tmp/gh-aw/benchmarks/analysis.json | python3 -m json.tool +cat /tmp/gh-aw/agent/benchmarks/analysis.json | python3 -m json.tool ``` ### 4.2 Open Issues for Regressions @@ -458,7 +458,7 @@ If regressions are detected, open issues with detailed information. Parse the analysis and create issues: ```bash -cat > /tmp/gh-aw/benchmarks/create_issues.py << 'EOF' +cat > /tmp/gh-aw/agent/benchmarks/create_issues.py << 'EOF' #!/usr/bin/env python3 """ Create GitHub issues for performance regressions @@ -466,7 +466,7 @@ Create GitHub issues for performance regressions import json import os -ANALYSIS_FILE = '/tmp/gh-aw/benchmarks/analysis.json' +ANALYSIS_FILE = '/tmp/gh-aw/agent/benchmarks/analysis.json' def main(): with open(ANALYSIS_FILE, 'r') as f: @@ -492,15 +492,15 @@ def main(): print(f" - {reg['name']}: {reg['change_percent']:+.1f}%") # Save regressions for processing - with open('/tmp/gh-aw/benchmarks/regressions.json', 'w') as f: + with open('/tmp/gh-aw/agent/benchmarks/regressions.json', 'w') as f: json.dump(regressions, f, indent=2) if __name__ == '__main__': main() EOF -chmod +x /tmp/gh-aw/benchmarks/create_issues.py -python3 /tmp/gh-aw/benchmarks/create_issues.py +chmod +x /tmp/gh-aw/agent/benchmarks/create_issues.py +python3 /tmp/gh-aw/agent/benchmarks/create_issues.py ``` Now, for each regression found, use the `create issue` tool to open an issue with the details. @@ -512,15 +512,15 @@ Now, for each regression found, use the `create issue` tool to open an issue wit Generate a comprehensive summary of today's benchmark run: ```bash -cat > /tmp/gh-aw/benchmarks/generate_report.py << 'EOF' +cat > /tmp/gh-aw/agent/benchmarks/generate_report.py << 'EOF' #!/usr/bin/env python3 """ Generate performance summary report with proper markdown formatting """ import json -ANALYSIS_FILE = '/tmp/gh-aw/benchmarks/analysis.json' -CURRENT_FILE = '/tmp/gh-aw/benchmarks/current_metrics.json' +ANALYSIS_FILE = '/tmp/gh-aw/agent/benchmarks/analysis.json' +CURRENT_FILE = '/tmp/gh-aw/agent/benchmarks/current_metrics.json' def format_ns(ns): """Format nanoseconds in human-readable form""" @@ -543,7 +543,7 @@ def main(): summary = analysis['summary'] # Generate markdown report following formatting guidelines - with open('/tmp/gh-aw/benchmarks/report.md', 'w') as f: + with open('/tmp/gh-aw/agent/benchmarks/report.md', 'w') as f: # Brief summary (always visible) f.write("### 📊 Performance Summary\n\n") f.write(f"**Date**: {analysis['date']} \n") @@ -646,8 +646,8 @@ if __name__ == '__main__': main() EOF -chmod +x /tmp/gh-aw/benchmarks/generate_report.py -python3 /tmp/gh-aw/benchmarks/generate_report.py +chmod +x /tmp/gh-aw/agent/benchmarks/generate_report.py +python3 /tmp/gh-aw/agent/benchmarks/generate_report.py ``` ## Success Criteria diff --git a/.github/workflows/daily-cli-tools-tester.md b/.github/workflows/daily-cli-tools-tester.md index 67f469b00f9..80141b4e0d5 100644 --- a/.github/workflows/daily-cli-tools-tester.md +++ b/.github/workflows/daily-cli-tools-tester.md @@ -428,14 +428,14 @@ Test whether compilation correctly detects changes: ```bash # Record current state -ls -la .github/workflows/*.lock.yml > /tmp/before.txt +ls -la .github/workflows/*.lock.yml > /tmp/gh-aw/agent/before.txt # Compile again without changes # Use the "compile" tool to recompile all workflows # Check if lock files changed -ls -la .github/workflows/*.lock.yml > /tmp/after.txt -diff /tmp/before.txt /tmp/after.txt +ls -la .github/workflows/*.lock.yml > /tmp/gh-aw/agent/after.txt +diff /tmp/gh-aw/agent/before.txt /tmp/gh-aw/agent/after.txt ``` **Expected**: Lock files should not change if markdown source hasn't changed @@ -538,7 +538,7 @@ Monitor resource consumption during testing: ```bash # Check disk usage -df -h /tmp/gh-aw/ +df -h /tmp/gh-aw/agent/ # Count log files downloaded find /tmp/gh-aw/aw-mcp/logs/ -type f | wc -l diff --git a/.github/workflows/daily-geo-optimizer.md b/.github/workflows/daily-geo-optimizer.md index a646419a249..9f243f346fe 100644 --- a/.github/workflows/daily-geo-optimizer.md +++ b/.github/workflows/daily-geo-optimizer.md @@ -47,23 +47,23 @@ jobs: run: pip install geo-optimizer-skill - name: Create results directory - run: mkdir -p /tmp/gh-aw/geo-optimizer + run: mkdir -p /tmp/gh-aw/agent/geo-optimizer - name: Audit documentation site homepage run: | geo audit --url https://github.github.com/gh-aw/ --format json \ - > /tmp/gh-aw/geo-optimizer/docs-site-audit.json 2>&1 || true + > /tmp/gh-aw/agent/geo-optimizer/docs-site-audit.json 2>&1 || true - name: Audit documentation sitemap run: | geo audit --sitemap https://github.github.com/gh-aw/sitemap.xml \ --max-urls 20 --format json \ - > /tmp/gh-aw/geo-optimizer/docs-sitemap-audit.json 2>&1 || true + > /tmp/gh-aw/agent/geo-optimizer/docs-sitemap-audit.json 2>&1 || true - name: Audit README via GitHub repository page run: | geo audit --url https://github.com/${{ github.repository }} --format json \ - > /tmp/gh-aw/geo-optimizer/readme-audit.json 2>&1 || true + > /tmp/gh-aw/agent/geo-optimizer/readme-audit.json 2>&1 || true - name: Write audit metadata run: | @@ -77,7 +77,7 @@ jobs: "readme_url": "https://github.com/${{ github.repository }}", "repository": "${{ github.repository }}", } - path = "/tmp/gh-aw/geo-optimizer/metadata.json" + path = "/tmp/gh-aw/agent/geo-optimizer/metadata.json" with open(path, "w") as f: json.dump(metadata, f, indent=2) print(f"Wrote metadata to {path}") @@ -87,7 +87,7 @@ jobs: uses: actions/upload-artifact@v7.0.1 with: name: geo-optimizer-results - path: /tmp/gh-aw/geo-optimizer + path: /tmp/gh-aw/agent/geo-optimizer if-no-files-found: error retention-days: 3 @@ -96,7 +96,7 @@ steps: uses: actions/download-artifact@v8.0.1 with: name: geo-optimizer-results - path: /tmp/gh-aw/geo-optimizer + path: /tmp/gh-aw/agent/geo-optimizer imports: - uses: shared/daily-audit-base.md @@ -121,7 +121,7 @@ You are the GEO (Generative Engine Optimization) audit agent. Your task is to an ## Your Mission -Analyze the GEO audit results downloaded from the `geo-optimizer-results` artifact into `/tmp/gh-aw/geo-optimizer/` and create a GitHub Discussion summarizing the findings and actionable recommendations to improve AI-engine citation coverage for this project. +Analyze the GEO audit results downloaded from the `geo-optimizer-results` artifact into `/tmp/gh-aw/agent/geo-optimizer/` and create a GitHub Discussion summarizing the findings and actionable recommendations to improve AI-engine citation coverage for this project. --- @@ -130,7 +130,7 @@ Analyze the GEO audit results downloaded from the `geo-optimizer-results` artifa Read all JSON files from the results directory: ```bash -ls /tmp/gh-aw/geo-optimizer/ +ls /tmp/gh-aw/agent/geo-optimizer/ ``` - `docs-site-audit.json` — full GEO audit of `https://github.github.com/gh-aw/` diff --git a/.github/workflows/daily-grafana-otel-instrumentation-advisor.md b/.github/workflows/daily-grafana-otel-instrumentation-advisor.md index d2839dcba45..730a7614e39 100644 --- a/.github/workflows/daily-grafana-otel-instrumentation-advisor.md +++ b/.github/workflows/daily-grafana-otel-instrumentation-advisor.md @@ -142,7 +142,7 @@ Using your expertise in OTel and DevOps observability, evaluate the instrumentat 3. **Resource attributes** - Are standard OTel resource attributes populated (`service.version`, `deployment.environment`, `github.repository`, `github.run_id`)? 4. **Error observability** - When a job fails, does the span carry the failure reason, not just the status code? 5. **Trace continuity** - Is the trace ID reliably propagated across all jobs (activation, agent, safe-outputs, conclusion)? -6. **Local JSONL mirror quality** - Is the local `/tmp/gh-aw/otel.jsonl` mirror useful for post-hoc debugging without a live collector? +6. **Local JSONL mirror quality** - Is the local `/tmp/gh-aw/agent/otel.jsonl` mirror useful for post-hoc debugging without a live collector? 7. **Span kind accuracy** - Are span kinds (CLIENT, SERVER, INTERNAL) accurate for each operation? ### Step 4: Select the Single Best Improvement diff --git a/.github/workflows/daily-issues-report.md b/.github/workflows/daily-issues-report.md index 51e2a771ab0..49a0c51314c 100644 --- a/.github/workflows/daily-issues-report.md +++ b/.github/workflows/daily-issues-report.md @@ -76,11 +76,11 @@ Generate a daily report analyzing up to 1000 issues from the repository (see `is ## Phase 1: Load and Prepare Data -The issues data has been pre-fetched and is available at `/tmp/gh-aw/issues-data/issues.json`. +The issues data has been pre-fetched and is available at `/tmp/gh-aw/agent/issues-data/issues.json`. 1. **Load the issues data**: ```bash - jq 'length' /tmp/gh-aw/issues-data/issues.json + jq 'length' /tmp/gh-aw/agent/issues-data/issues.json ``` 2. **Prepare data for Python analysis**: diff --git a/.github/workflows/daily-malicious-code-scan.md b/.github/workflows/daily-malicious-code-scan.md index 544fd502852..ad8ccf1940f 100644 --- a/.github/workflows/daily-malicious-code-scan.md +++ b/.github/workflows/daily-malicious-code-scan.md @@ -65,10 +65,10 @@ Since this is a fresh clone, fetch the complete git history: git fetch --unshallow || echo "Repository already has full history" # Get list of files changed in last 3 days -git log --since="3 days ago" --name-only --pretty=format: | sort | uniq > /tmp/changed_files.txt +git log --since="3 days ago" --name-only --pretty=format: | sort | uniq > /tmp/gh-aw/agent/changed_files.txt # Get commit details for context -git log --since="3 days ago" --pretty=format:"%h - %an, %ar : %s" > /tmp/recent_commits.txt +git log --since="3 days ago" --pretty=format:"%h - %an, %ar : %s" > /tmp/gh-aw/agent/recent_commits.txt ``` ### 2. Suspicious Pattern Detection @@ -86,7 +86,7 @@ Look for these red flags in the changed code: **Example patterns to detect:** ```bash # Search for suspicious network patterns -grep -E "(curl|wget|fetch|http\.get|requests\.)" /tmp/changed_files.txt | while read -r file; do +grep -E "(curl|wget|fetch|http\.get|requests\.)" /tmp/gh-aw/agent/changed_files.txt | while read -r file; do if [ -f "$file" ]; then echo "Checking: $file" # Check for secrets + network combination diff --git a/.github/workflows/daily-model-inventory.md b/.github/workflows/daily-model-inventory.md index 1ae17460af7..5a27964a61f 100644 --- a/.github/workflows/daily-model-inventory.md +++ b/.github/workflows/daily-model-inventory.md @@ -31,7 +31,7 @@ jobs: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} run: | set -euo pipefail - OUT="/tmp/gh-aw/model-inventory/openai" + OUT="/tmp/gh-aw/agent/model-inventory/openai" mkdir -p "$OUT" if [ -z "${OPENAI_API_KEY:-}" ]; then echo '{"provider":"openai","error":"OPENAI_API_KEY not set","models":[]}' > "$OUT/models.json" @@ -65,8 +65,8 @@ jobs: with: name: openai-models path: | - /tmp/gh-aw/model-inventory/openai/models.json - /tmp/gh-aw/model-inventory/openai/raw.json + /tmp/gh-aw/agent/model-inventory/openai/models.json + /tmp/gh-aw/agent/model-inventory/openai/raw.json if-no-files-found: error retention-days: 7 @@ -83,7 +83,7 @@ jobs: ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} run: | set -euo pipefail - OUT="/tmp/gh-aw/model-inventory/anthropic" + OUT="/tmp/gh-aw/agent/model-inventory/anthropic" mkdir -p "$OUT" if [ -z "${ANTHROPIC_API_KEY:-}" ]; then echo '{"provider":"anthropic","error":"ANTHROPIC_API_KEY not set","models":[]}' > "$OUT/models.json" @@ -119,8 +119,8 @@ jobs: with: name: anthropic-models path: | - /tmp/gh-aw/model-inventory/anthropic/models.json - /tmp/gh-aw/model-inventory/anthropic/raw.json + /tmp/gh-aw/agent/model-inventory/anthropic/models.json + /tmp/gh-aw/agent/model-inventory/anthropic/raw.json if-no-files-found: error retention-days: 7 @@ -137,7 +137,7 @@ jobs: GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} run: | set -euo pipefail - OUT="/tmp/gh-aw/model-inventory/gemini" + OUT="/tmp/gh-aw/agent/model-inventory/gemini" mkdir -p "$OUT" if [ -z "${GEMINI_API_KEY:-}" ]; then echo '{"provider":"gemini","error":"GEMINI_API_KEY not set","models":[]}' > "$OUT/models.json" @@ -174,8 +174,8 @@ jobs: with: name: gemini-models path: | - /tmp/gh-aw/model-inventory/gemini/models.json - /tmp/gh-aw/model-inventory/gemini/raw.json + /tmp/gh-aw/agent/model-inventory/gemini/models.json + /tmp/gh-aw/agent/model-inventory/gemini/raw.json if-no-files-found: error retention-days: 7 @@ -190,7 +190,7 @@ jobs: shell: bash run: | set -euo pipefail - OUT="/tmp/gh-aw/model-inventory/copilot-billing" + OUT="/tmp/gh-aw/agent/model-inventory/copilot-billing" mkdir -p "$OUT" python3 - <<'PYEOF' import json, sys, urllib.request, html.parser @@ -241,7 +241,7 @@ jobs: html_content = resp.read().decode("utf-8", errors="replace") except Exception as e: result = {"source": URL, "error": str(e), "headers": [], "models": []} - with open("/tmp/gh-aw/model-inventory/copilot-billing/multipliers.json", "w") as f: + with open("/tmp/gh-aw/agent/model-inventory/copilot-billing/multipliers.json", "w") as f: json.dump(result, f, indent=2) print(f"Error fetching page: {e}", file=sys.stderr) sys.exit(0) @@ -257,7 +257,7 @@ jobs: models.append(entry) result = {"source": URL, "headers": parser.headers, "models": models} - out_path = "/tmp/gh-aw/model-inventory/copilot-billing/multipliers.json" + out_path = "/tmp/gh-aw/agent/model-inventory/copilot-billing/multipliers.json" with open(out_path, "w") as f: json.dump(result, f, indent=2) print(f"Extracted {len(models)} model multiplier entries", file=sys.stderr) @@ -269,7 +269,7 @@ jobs: uses: actions/upload-artifact@v7.0.1 with: name: copilot-billing-multipliers - path: /tmp/gh-aw/model-inventory/copilot-billing/multipliers.json + path: /tmp/gh-aw/agent/model-inventory/copilot-billing/multipliers.json if-no-files-found: error retention-days: 7 @@ -277,13 +277,13 @@ steps: - name: Download all model artifacts uses: actions/download-artifact@v8.0.1 with: - path: /tmp/gh-aw/model-inventory/artifacts + path: /tmp/gh-aw/agent/model-inventory/artifacts - name: Merge artifacts into combined inventory shell: bash run: | - INVENTORY="/tmp/gh-aw/model-inventory/inventory.json" - jq -s '.' /tmp/gh-aw/model-inventory/artifacts/*/models.json > "$INVENTORY" + INVENTORY="/tmp/gh-aw/agent/model-inventory/inventory.json" + jq -s '.' /tmp/gh-aw/agent/model-inventory/artifacts/*/models.json > "$INVENTORY" echo "Combined inventory written to $INVENTORY" cat "$INVENTORY" @@ -321,10 +321,10 @@ updating. The pre-job steps have already fetched model lists from OpenAI, Anthropic, and Gemini, then merged them into: -- Combined inventory: `/tmp/gh-aw/model-inventory/inventory.json` -- Individual provider files: `/tmp/gh-aw/model-inventory/artifacts/-models/models.json` -- Raw provider responses: `/tmp/gh-aw/model-inventory/artifacts/-models/raw.json` -- Copilot live provider metadata: `/tmp/gh-aw/model-inventory/reflect.json` (generated in +- Combined inventory: `/tmp/gh-aw/agent/model-inventory/inventory.json` +- Individual provider files: `/tmp/gh-aw/agent/model-inventory/artifacts/-models/models.json` +- Raw provider responses: `/tmp/gh-aw/agent/model-inventory/artifacts/-models/raw.json` +- Copilot live provider metadata: `/tmp/gh-aw/agent/model-inventory/reflect.json` (generated in Step 0 below; filter `.endpoints[] | select(.provider == "copilot") | .models`). If the file contains an `error` field, treat Copilot data as unavailable for this run and continue with the remaining providers. @@ -382,13 +382,13 @@ The alias pattern syntax is: Before loading the inventory, fetch Copilot model metadata from the AWF `api-proxy` `/reflect` endpoint from within this agent execution context and write it to: -`/tmp/gh-aw/model-inventory/reflect.json`. +`/tmp/gh-aw/agent/model-inventory/reflect.json`. Run: ```bash set -euo pipefail -OUT="/tmp/gh-aw/model-inventory/reflect.json" +OUT="/tmp/gh-aw/agent/model-inventory/reflect.json" mkdir -p "$(dirname "$OUT")" if ! curl -fsS http://api-proxy:10000/reflect > "$OUT"; then printf '%s' '{"endpoints":[],"error":"reflect endpoint unavailable"}' > "$OUT" @@ -422,8 +422,8 @@ echo "Copilot reflect metadata written to $OUT" ### Step 1: Load and Validate the Inventory -Read the combined inventory from `/tmp/gh-aw/model-inventory/inventory.json`. Then read -the `/tmp/gh-aw/model-inventory/reflect.json` file from Step 0 and extract the configured +Read the combined inventory from `/tmp/gh-aw/agent/model-inventory/inventory.json`. Then read +the `/tmp/gh-aw/agent/model-inventory/reflect.json` file from Step 0 and extract the configured `copilot` endpoint (`.endpoints[] | select(.provider == "copilot" and .configured)`). List the providers that returned data and the count of models available from each, including @@ -436,8 +436,8 @@ unavailable and continue. For each provider that returned data, examine the raw response to identify all available fields: -- OpenAI / Anthropic / Gemini: `/tmp/gh-aw/model-inventory/artifacts/-models/raw.json` -- Copilot: `/tmp/gh-aw/model-inventory/reflect.json` filtered to the `copilot` endpoint object +- OpenAI / Anthropic / Gemini: `/tmp/gh-aw/agent/model-inventory/artifacts/-models/raw.json` +- Copilot: `/tmp/gh-aw/agent/model-inventory/reflect.json` filtered to the `copilot` endpoint object Specifically look for: @@ -459,7 +459,7 @@ Read the current built-in multiplier table from `pkg/cli/data/model_multipliers. The pre-job step has also fetched the **official GitHub Copilot billing multipliers** from the documentation page and stored them as: -- `/tmp/gh-aw/model-inventory/artifacts/copilot-billing-multipliers/multipliers.json` +- `/tmp/gh-aw/agent/model-inventory/artifacts/copilot-billing-multipliers/multipliers.json` This file contains the authoritative ET multipliers per model extracted from `https://docs.github.com/en/copilot/reference/copilot-billing/model-multipliers-for-annual-plans`, @@ -472,7 +472,7 @@ failed or returned an empty model list, fall back to the heuristics below. For each provider's enriched data, attempt to infer or validate the ET multiplier for each model: 1. **Copilot reflect data** — use the `copilot` endpoint's `models` list from - `/tmp/gh-aw/model-inventory/reflect.json` as the live model source, then match model + `/tmp/gh-aw/agent/model-inventory/reflect.json` as the live model source, then match model names/IDs against the official docs table first. If a match is found, use the `New multiplier` as the authoritative value. Compare against the matching entry in `model_multipliers.json`, and list discrepancies or missing models. diff --git a/.github/workflows/daily-multi-device-docs-tester.md b/.github/workflows/daily-multi-device-docs-tester.md index 12afbacd78f..479404ac311 100644 --- a/.github/workflows/daily-multi-device-docs-tester.md +++ b/.github/workflows/daily-multi-device-docs-tester.md @@ -81,8 +81,8 @@ pre-agent-steps: EXPR_GITHUB_RUN_ID: ${{ github.run_id }} EXPR_GITHUB_WORKSPACE: ${{ github.workspace }} run: | - LOG_FILE="/tmp/gh-aw/docs-server-$EXPR_GITHUB_RUN_ID.log" - PID_FILE="/tmp/gh-aw/docs-server-$EXPR_GITHUB_RUN_ID.pid" + LOG_FILE="/tmp/gh-aw/agent/docs-server-$EXPR_GITHUB_RUN_ID.log" + PID_FILE="/tmp/gh-aw/agent/docs-server-$EXPR_GITHUB_RUN_ID.pid" cd "$EXPR_GITHUB_WORKSPACE/docs" nohup npm run dev -- --host 0.0.0.0 --port 4321 > "$LOG_FILE" 2>&1 & PID=$! @@ -93,8 +93,8 @@ pre-agent-steps: env: EXPR_GITHUB_RUN_ID: ${{ github.run_id }} run: | - PID_FILE="/tmp/gh-aw/docs-server-$EXPR_GITHUB_RUN_ID.pid" - LOG_FILE="/tmp/gh-aw/docs-server-$EXPR_GITHUB_RUN_ID.log" + PID_FILE="/tmp/gh-aw/agent/docs-server-$EXPR_GITHUB_RUN_ID.pid" + LOG_FILE="/tmp/gh-aw/agent/docs-server-$EXPR_GITHUB_RUN_ID.log" MAX_WAIT=135 # Maximum 135 seconds wait time WAITED=0 until curl -sf http://localhost:4321/gh-aw/ > /dev/null 2>&1; do diff --git a/.github/workflows/daily-news.md b/.github/workflows/daily-news.md index 9baf6bece23..221595553a4 100644 --- a/.github/workflows/daily-news.md +++ b/.github/workflows/daily-news.md @@ -88,7 +88,7 @@ steps: set -e # Create directories - mkdir -p /tmp/gh-aw/daily-news-data + mkdir -p /tmp/gh-aw/agent/daily-news-data mkdir -p /tmp/gh-aw/repo-memory/default/daily-news-data # Check if cached data exists and is recent (< 24 hours old) @@ -111,7 +111,7 @@ steps: # Use cached data if valid if [ "$CACHE_VALID" = true ]; then echo "📦 Using cached data from previous run" - cp -r /tmp/gh-aw/repo-memory/default/daily-news-data/* /tmp/gh-aw/daily-news-data/ + cp -r /tmp/gh-aw/repo-memory/default/daily-news-data/* /tmp/gh-aw/agent/daily-news-data/ echo "✅ Cached data restored to working directory" echo "cache_valid=true" >> "$GITHUB_OUTPUT" else @@ -161,7 +161,7 @@ steps: } } } - " -f owner="${GITHUB_REPOSITORY_OWNER}" -f repo="${GITHUB_REPOSITORY#*/}" > /tmp/gh-aw/daily-news-data/issues.json + " -f owner="${GITHUB_REPOSITORY_OWNER}" -f repo="${GITHUB_REPOSITORY#*/}" > /tmp/gh-aw/agent/daily-news-data/issues.json echo "✅ Issues data fetched" - name: Fetch pull requests @@ -214,7 +214,7 @@ steps: } } } - " -f owner="${GITHUB_REPOSITORY_OWNER}" -f repo="${GITHUB_REPOSITORY#*/}" > /tmp/gh-aw/daily-news-data/pull_requests.json + " -f owner="${GITHUB_REPOSITORY_OWNER}" -f repo="${GITHUB_REPOSITORY#*/}" > /tmp/gh-aw/agent/daily-news-data/pull_requests.json echo "✅ Pull requests data fetched" - name: Fetch commits @@ -228,7 +228,7 @@ steps: gh api "repos/${GITHUB_REPOSITORY}/commits" \ --paginate \ --jq '[.[] | {sha, author: .commit.author, message: .commit.message, date: .commit.author.date, html_url}]' \ - > /tmp/gh-aw/daily-news-data/commits.json + > /tmp/gh-aw/agent/daily-news-data/commits.json echo "✅ Commits data fetched" - name: Fetch releases @@ -241,7 +241,7 @@ steps: echo "Fetching releases..." gh api "repos/${GITHUB_REPOSITORY}/releases" \ --jq '[.[] | {tag_name, name, created_at, published_at, html_url, body}]' \ - > /tmp/gh-aw/daily-news-data/releases.json + > /tmp/gh-aw/agent/daily-news-data/releases.json echo "✅ Releases data fetched" - name: Fetch discussions @@ -269,7 +269,7 @@ steps: } } } - " -f owner="${GITHUB_REPOSITORY_OWNER}" -f repo="${GITHUB_REPOSITORY#*/}" > /tmp/gh-aw/daily-news-data/discussions.json + " -f owner="${GITHUB_REPOSITORY_OWNER}" -f repo="${GITHUB_REPOSITORY#*/}" > /tmp/gh-aw/agent/daily-news-data/discussions.json echo "✅ Discussions data fetched" - name: Check for changesets @@ -281,9 +281,9 @@ steps: set -e echo "Checking for changesets..." if [ -d ".changeset" ]; then - find .changeset -name "*.md" -type f ! -name "README.md" > /tmp/gh-aw/daily-news-data/changesets.txt + find .changeset -name "*.md" -type f ! -name "README.md" > /tmp/gh-aw/agent/daily-news-data/changesets.txt else - echo "No changeset directory" > /tmp/gh-aw/daily-news-data/changesets.txt + echo "No changeset directory" > /tmp/gh-aw/agent/daily-news-data/changesets.txt fi echo "✅ Changeset check complete" @@ -295,7 +295,7 @@ steps: run: | set -e echo "💾 Caching data for future runs..." - cp -r /tmp/gh-aw/daily-news-data/* /tmp/gh-aw/repo-memory/default/daily-news-data/ + cp -r /tmp/gh-aw/agent/daily-news-data/* /tmp/gh-aw/repo-memory/default/daily-news-data/ date +%s > "/tmp/gh-aw/repo-memory/default/daily-news-data/.timestamp" echo "✅ Data caching complete" @@ -304,7 +304,7 @@ steps: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - find /tmp/gh-aw/daily-news-data/ -maxdepth 1 -ls + find /tmp/gh-aw/agent/daily-news-data/ -maxdepth 1 -ls imports: - uses: shared/repo-memory-standard.md @@ -334,7 +334,7 @@ Write an upbeat, friendly, motivating summary of recent activity in the repo. ## 📁 Pre-Downloaded Data Available -**IMPORTANT**: All GitHub data has been pre-downloaded to `/tmp/gh-aw/daily-news-data/` to avoid excessive MCP calls. Use these files instead of making GitHub API calls: +**IMPORTANT**: All GitHub data has been pre-downloaded to `/tmp/gh-aw/agent/daily-news-data/` to avoid excessive MCP calls. Use these files instead of making GitHub API calls: - **`issues.json`** - Open and recently closed issues (last 100 of each) - **`pull_requests.json`** - Open, merged, and closed pull requests @@ -363,7 +363,7 @@ Write an upbeat, friendly, motivating summary of recent activity in the repo. ## 📊 Trend Charts Requirement Generate exactly **2 trend charts** (issues/PRs activity and commit activity) using data from -`/tmp/gh-aw/daily-news-data/`. Use Python (pandas + matplotlib/seaborn) to process the JSON +`/tmp/gh-aw/agent/daily-news-data/`. Use Python (pandas + matplotlib/seaborn) to process the JSON files, produce PNGs at 300 DPI, upload them via `upload asset`, and embed them in the discussion under a `### 📈 Trend Analysis` section with a 2-3 sentence interpretation each. {{else}} @@ -371,13 +371,13 @@ discussion under a `### 📈 Trend Analysis` section with a 2-3 sentence interpr **IMPORTANT**: Generate exactly 2 trend charts that showcase key metrics of the project. These charts should visualize trends over time to give the team insights into project health and activity patterns. -Use the pre-downloaded data from `/tmp/gh-aw/daily-news-data/` to generate all statistics and charts. +Use the pre-downloaded data from `/tmp/gh-aw/agent/daily-news-data/` to generate all statistics and charts. ### Chart Generation Process **Phase 1: Data Collection** -**Use the pre-downloaded data files** from `/tmp/gh-aw/daily-news-data/`: +**Use the pre-downloaded data files** from `/tmp/gh-aw/agent/daily-news-data/`: 1. **Issues Activity Data**: Load from `issues.json` - Parse `openIssues.nodes` and `closedIssues.nodes` @@ -404,7 +404,7 @@ Use the pre-downloaded data from `/tmp/gh-aw/daily-news-data/` to generate all s **Phase 2: Data Preparation** 1. Create a Python script at `/tmp/gh-aw/python/process_data.py` that: - - Reads the JSON files from `/tmp/gh-aw/daily-news-data/` + - Reads the JSON files from `/tmp/gh-aw/agent/daily-news-data/` - Processes timestamps and aggregates by date - Generates CSV files in `/tmp/gh-aw/python/data/`: - `issues_prs_activity.csv` - Daily counts of issues and PRs @@ -502,13 +502,13 @@ If insufficient data is available (less than 7 days): --- {{#if experiments.prompt_style == "concise"}} -Read from the pre-downloaded files in `/tmp/gh-aw/daily-news-data/` (`issues.json`, +Read from the pre-downloaded files in `/tmp/gh-aw/agent/daily-news-data/` (`issues.json`, `pull_requests.json`, `commits.json`, `discussions.json`, `releases.json`, `changesets.txt`). Write an upbeat, emoji-accented digest covering: top issues and PRs, notable commits, community engagement, productivity suggestions, and a closing haiku. Create a GitHub discussion titled "Daily Status - ". {{else}} -**Data Sources** - Use the pre-downloaded files in `/tmp/gh-aw/daily-news-data/`: +**Data Sources** - Use the pre-downloaded files in `/tmp/gh-aw/agent/daily-news-data/`: - Include some or all of the following from the JSON files: * Recent issues activity (from `issues.json`) * Recent pull requests (from `pull_requests.json`) @@ -533,7 +533,7 @@ Create a GitHub discussion titled "Daily Status - ". - In a note at the end of the report, include a log of: * All web search queries you used (if any) - * All files you read from `/tmp/gh-aw/daily-news-data/` + * All files you read from `/tmp/gh-aw/agent/daily-news-data/` * Summary statistics: number of issues/PRs/commits/discussions analyzed * Date range of data analyzed * Any data limitations encountered diff --git a/.github/workflows/daily-otel-instrumentation-advisor.md b/.github/workflows/daily-otel-instrumentation-advisor.md index d371a9b25bd..c7d68999290 100644 --- a/.github/workflows/daily-otel-instrumentation-advisor.md +++ b/.github/workflows/daily-otel-instrumentation-advisor.md @@ -132,7 +132,7 @@ Using your expertise in OTel and DevOps observability, evaluate the instrumentat 3. **Resource attributes** — Are standard OTel resource attributes populated (`service.version`, `deployment.environment`, `github.repository`, `github.run_id`)? 4. **Error observability** — When a job fails, does the span carry the failure reason, not just the status code? 5. **Trace continuity** — Is the trace ID reliably propagated across all jobs (activation, agent, safe-outputs, conclusion)? -6. **Local JSONL mirror quality** — Is the local `/tmp/gh-aw/otel.jsonl` mirror useful for post-hoc debugging without a live collector? +6. **Local JSONL mirror quality** — Is the local `/tmp/gh-aw/agent/otel.jsonl` mirror useful for post-hoc debugging without a live collector? 7. **Span kind accuracy** — Are span kinds (CLIENT, SERVER, INTERNAL) accurate for each operation? ### Step 4: Select the Single Best Improvement diff --git a/.github/workflows/daily-regulatory.md b/.github/workflows/daily-regulatory.md index 59b8110ac7b..daa7dc4bffc 100644 --- a/.github/workflows/daily-regulatory.md +++ b/.github/workflows/daily-regulatory.md @@ -190,9 +190,9 @@ Example parsing approach (for each discussion in your data): # For each discussion body extracted from the query results, parse metrics # Extract numeric patterns from discussion body content -grep -oE '[0-9,]+\s+(issues|PRs|tokens|runs)' /tmp/report.md -grep -oE '\$[0-9]+\.[0-9]+' /tmp/report.md # Cost values -grep -oE '[0-9]+%' /tmp/report.md # Percentages +grep -oE '[0-9,]+\s+(issues|PRs|tokens|runs)' /tmp/gh-aw/agent/report.md +grep -oE '\$[0-9]+\.[0-9]+' /tmp/gh-aw/agent/report.md # Cost values +grep -oE '[0-9]+%' /tmp/gh-aw/agent/report.md # Percentages ``` ## Phase 3: Cross-Check Data Consistency diff --git a/.github/workflows/daily-rendering-scripts-verifier.md b/.github/workflows/daily-rendering-scripts-verifier.md index e11d8a00287..4ecca404d3c 100644 --- a/.github/workflows/daily-rendering-scripts-verifier.md +++ b/.github/workflows/daily-rendering-scripts-verifier.md @@ -140,7 +140,7 @@ Note the engine type, total tokens, and any errors in the audit output. Create a test harness that mocks GitHub Actions globals and runs the engine-specific parser: ```bash -cat > /tmp/gh-aw-parser-harness.cjs << 'EOF' +cat > /tmp/gh-aw/agent-parser-harness.cjs << 'EOF' // @ts-check "use strict"; @@ -223,7 +223,7 @@ AGENT_OUTPUT_FILE="$(find /tmp/gh-aw/aw-mcp/logs/run-* -name 'agent-stdio.log' - echo "Engine: $ENGINE" echo "Agent output file: $AGENT_OUTPUT_FILE" -node /tmp/gh-aw-parser-harness.cjs "$AGENT_OUTPUT_FILE" "$ENGINE" +node /tmp/gh-aw/agent-parser-harness.cjs "$AGENT_OUTPUT_FILE" "$ENGINE" echo "Exit code: $?" ``` @@ -234,7 +234,7 @@ Capture the full output and exit code. A non-zero exit code or `[ERROR]`/`[FAILU Test the `render_template.cjs` rendering logic with known cases: ```bash -cat > /tmp/gh-aw-render-test.cjs << 'EOF' +cat > /tmp/gh-aw/agent-render-test.cjs << 'EOF' // @ts-check "use strict"; @@ -295,7 +295,7 @@ console.log("\nResults:", passed, "passed,", failed, "failed"); EOF cd ${{ github.workspace }}/actions/setup/js -node /tmp/gh-aw-render-test.cjs +node /tmp/gh-aw/agent-render-test.cjs echo "Render test exit code: $?" ``` @@ -346,8 +346,8 @@ If you found parser or rendering issues: 3. **Verify the fix resolves the issue**: ```bash cd ${{ github.workspace }}/actions/setup/js - node /tmp/gh-aw-parser-harness.cjs "$AGENT_OUTPUT_FILE" "$ENGINE" - node /tmp/gh-aw-render-test.cjs + node /tmp/gh-aw/agent-parser-harness.cjs "$AGENT_OUTPUT_FILE" "$ENGINE" + node /tmp/gh-aw/agent-render-test.cjs ``` 4. **Run the existing test suite** to ensure no regressions: diff --git a/.github/workflows/daily-safe-output-integrator.md b/.github/workflows/daily-safe-output-integrator.md index 08d046dfbf5..d7056964ed2 100644 --- a/.github/workflows/daily-safe-output-integrator.md +++ b/.github/workflows/daily-safe-output-integrator.md @@ -197,10 +197,10 @@ print(f'Total missing: {len(missing)}') Run the script: ```bash -python3 /tmp/check_coverage.py +python3 /tmp/gh-aw/agent/check_coverage.py ``` -(Save the script content to `/tmp/check_coverage.py` first using the edit tool, then run it.) +(Save the script content to `/tmp/gh-aw/agent/check_coverage.py` first using the edit tool, then run it.) ## Phase 3: Scan Existing Go Tests diff --git a/.github/workflows/daily-safe-outputs-conformance.md b/.github/workflows/daily-safe-outputs-conformance.md index 489ec169d89..4835ef09791 100644 --- a/.github/workflows/daily-safe-outputs-conformance.md +++ b/.github/workflows/daily-safe-outputs-conformance.md @@ -64,7 +64,7 @@ Execute the conformance checker script and capture its output: ```bash cd /home/runner/work/gh-aw/gh-aw -bash scripts/check-safe-outputs-conformance.sh 2>&1 | tee /tmp/conformance-results.txt +bash scripts/check-safe-outputs-conformance.sh 2>&1 | tee /tmp/gh-aw/agent/conformance-results.txt exit_code=${PIPESTATUS[0]} echo "Exit code: $exit_code" ``` @@ -76,13 +76,13 @@ echo "Exit code: $exit_code" ## Phase 2: Parse and Analyze Results -Analyze the output from `/tmp/conformance-results.txt`: +Analyze the output from `/tmp/gh-aw/agent/conformance-results.txt`: 1. **Extract failure counts** from the summary section: - - Critical Failures: `grep "Critical Failures:" /tmp/conformance-results.txt` - - High Failures: `grep "High Failures:" /tmp/conformance-results.txt` - - Medium Failures: `grep "Medium Failures:" /tmp/conformance-results.txt` - - Low Failures: `grep "Low Failures:" /tmp/conformance-results.txt` + - Critical Failures: `grep "Critical Failures:" /tmp/gh-aw/agent/conformance-results.txt` + - High Failures: `grep "High Failures:" /tmp/gh-aw/agent/conformance-results.txt` + - Medium Failures: `grep "Medium Failures:" /tmp/gh-aw/agent/conformance-results.txt` + - Low Failures: `grep "Low Failures:" /tmp/gh-aw/agent/conformance-results.txt` 2. **Extract specific check failures** by parsing lines that start with: - `[CRITICAL]` - Security violations requiring immediate attention diff --git a/.github/workflows/daily-secrets-analysis.md b/.github/workflows/daily-secrets-analysis.md index 7cf8e16fa05..a8dc14d7f99 100644 --- a/.github/workflows/daily-secrets-analysis.md +++ b/.github/workflows/daily-secrets-analysis.md @@ -79,9 +79,9 @@ echo "Total github.token references: $TOKEN_REFS" # Extract unique secret names grep -roh 'secrets\.[A-Z_]*' .github/workflows/*.lock.yml 2>/dev/null | \ awk -F'.' '{print $2}' | \ - sort -u > /tmp/gh-aw/secret-names.txt + sort -u > /tmp/gh-aw/agent/secret-names.txt -SECRET_TYPES=$(wc -l < /tmp/gh-aw/secret-names.txt) +SECRET_TYPES=$(wc -l < /tmp/gh-aw/agent/secret-names.txt) echo "Unique secret types: $SECRET_TYPES" ``` @@ -91,14 +91,14 @@ Count usage of each secret type: ```bash # Create usage report -cat /tmp/gh-aw/secret-names.txt | while read secret_name; do +cat /tmp/gh-aw/agent/secret-names.txt | while read secret_name; do count=$(grep -rh "secrets\.${secret_name}" .github/workflows/*.lock.yml 2>/dev/null | wc -l) echo "${count}|${secret_name}" -done | sort -rn > /tmp/gh-aw/secret-usage.txt +done | sort -rn > /tmp/gh-aw/agent/secret-usage.txt # Show top 10 secrets echo "=== Top 10 Secrets by Usage ===" -head -10 /tmp/gh-aw/secret-usage.txt | while IFS='|' read count name; do +head -10 /tmp/gh-aw/agent/secret-usage.txt | while IFS='|' read count name; do echo " $name: $count occurrences" done ``` @@ -176,7 +176,7 @@ If available, compare with historical data (this will work after first run): ```bash # Save current stats for next run -cat > /tmp/gh-aw/secrets-stats.json << EOF +cat > /tmp/gh-aw/agent/secrets-stats.json << EOF { "date": "$(date -I)", "total_workflows": $TOTAL_WORKFLOWS, diff --git a/.github/workflows/daily-security-observability.md b/.github/workflows/daily-security-observability.md index ad3e9efd2ec..eb5e024fe7d 100644 --- a/.github/workflows/daily-security-observability.md +++ b/.github/workflows/daily-security-observability.md @@ -33,17 +33,17 @@ steps: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - mkdir -p /tmp/gh-aw/integrity + mkdir -p /tmp/gh-aw/agent/integrity # Download logs filtered to only runs with DIFC integrity-filtered events gh aw logs --filtered-integrity --start-date -7d --json -c 200 \ - > /tmp/gh-aw/integrity/filtered-logs.json + > /tmp/gh-aw/agent/integrity/filtered-logs.json - if [ -f /tmp/gh-aw/integrity/filtered-logs.json ]; then - count=$(jq '. | length' /tmp/gh-aw/integrity/filtered-logs.json 2>/dev/null || echo 0) + if [ -f /tmp/gh-aw/agent/integrity/filtered-logs.json ]; then + count=$(jq '. | length' /tmp/gh-aw/agent/integrity/filtered-logs.json 2>/dev/null || echo 0) echo "✅ Downloaded $count runs with integrity-filtered events" else echo "⚠️ No logs file produced; continuing with empty dataset" - echo "[]" > /tmp/gh-aw/integrity/filtered-logs.json + echo "[]" > /tmp/gh-aw/agent/integrity/filtered-logs.json fi tools: @@ -166,11 +166,11 @@ Upload both charts using `upload_asset` and record the returned URLs. ### Step 3.1: Check for DIFC Data -Read `/tmp/gh-aw/integrity/filtered-logs.json`. If the array is empty (no runs found in the last 7 days), note "No DIFC integrity-filtered events found in the last 7 days." and proceed directly to Phase 5 (combined report). +Read `/tmp/gh-aw/agent/integrity/filtered-logs.json`. If the array is empty (no runs found in the last 7 days), note "No DIFC integrity-filtered events found in the last 7 days." and proceed directly to Phase 5 (combined report). ### Step 3.2: Fetch Detailed DIFC Gateway Data -1. Read `/tmp/gh-aw/integrity/filtered-logs.json` and extract all run IDs from each entry's `databaseId` field. +1. Read `/tmp/gh-aw/agent/integrity/filtered-logs.json` and extract all run IDs from each entry's `databaseId` field. 2. For each run ID, call the `audit` tool to get its detailed DIFC filtered events: ```json @@ -190,11 +190,11 @@ The audit result contains `gateway_analysis.filtered_events[]` with fields: - `author_login` — login of the triggering actor 3. Annotate each event with `workflow_name` (from `workflowName`) and `run_id` (from `databaseId`). -4. Save all annotated events to `/tmp/gh-aw/integrity/all-events.json`. +4. Save all annotated events to `/tmp/gh-aw/agent/integrity/all-events.json`. ### Step 3.3: Bucketize DIFC Events -Create and run `/tmp/gh-aw/integrity/bucketize.py`: +Create and run `/tmp/gh-aw/agent/integrity/bucketize.py`: ```python #!/usr/bin/env python3 @@ -204,7 +204,7 @@ import os from collections import defaultdict, Counter from datetime import datetime, timedelta -DATA_DIR = "/tmp/gh-aw/integrity" +DATA_DIR = "/tmp/gh-aw/agent/integrity" os.makedirs(DATA_DIR, exist_ok=True) with open(f"{DATA_DIR}/all-events.json") as f: @@ -264,21 +264,21 @@ print(f"Bucketized {len(events)} events.") print(json.dumps(summary, indent=2)) ``` -Run the script: `python3 /tmp/gh-aw/integrity/bucketize.py` +Run the script: `python3 /tmp/gh-aw/agent/integrity/bucketize.py` --- ## Phase 4: Generate DIFC Statistical Charts -Create and run chart scripts using matplotlib/seaborn. Save all charts to `/tmp/gh-aw/integrity/charts/`. +Create and run chart scripts using matplotlib/seaborn. Save all charts to `/tmp/gh-aw/agent/integrity/charts/`. ```bash -mkdir -p /tmp/gh-aw/integrity/charts +mkdir -p /tmp/gh-aw/agent/integrity/charts ``` ### Chart 3: DIFC Events Over Time (Daily) -Create `/tmp/gh-aw/integrity/chart_timeline.py`: +Create `/tmp/gh-aw/agent/integrity/chart_timeline.py`: ```python #!/usr/bin/env python3 @@ -289,7 +289,7 @@ import matplotlib.dates as mdates import seaborn as sns from datetime import datetime -DATA_DIR = "/tmp/gh-aw/integrity" +DATA_DIR = "/tmp/gh-aw/agent/integrity" CHARTS_DIR = f"{DATA_DIR}/charts" os.makedirs(CHARTS_DIR, exist_ok=True) @@ -319,11 +319,11 @@ plt.savefig(f"{CHARTS_DIR}/events_timeline.png", dpi=300, bbox_inches="tight", f print("Chart 3 saved.") ``` -Run: `python3 /tmp/gh-aw/integrity/chart_timeline.py` +Run: `python3 /tmp/gh-aw/agent/integrity/chart_timeline.py` ### Chart 4: Top Filtered Tools (Horizontal Bar) -Create `/tmp/gh-aw/integrity/chart_tools.py`: +Create `/tmp/gh-aw/agent/integrity/chart_tools.py`: ```python #!/usr/bin/env python3 @@ -332,7 +332,7 @@ import json, os import matplotlib.pyplot as plt import seaborn as sns -DATA_DIR = "/tmp/gh-aw/integrity" +DATA_DIR = "/tmp/gh-aw/agent/integrity" CHARTS_DIR = f"{DATA_DIR}/charts" os.makedirs(CHARTS_DIR, exist_ok=True) @@ -363,11 +363,11 @@ plt.savefig(f"{CHARTS_DIR}/top_tools.png", dpi=300, bbox_inches="tight", facecol print("Chart 4 saved.") ``` -Run: `python3 /tmp/gh-aw/integrity/chart_tools.py` +Run: `python3 /tmp/gh-aw/agent/integrity/chart_tools.py` ### Chart 5: Filter Reason Breakdown (Pie / Donut) -Create `/tmp/gh-aw/integrity/chart_reasons.py`: +Create `/tmp/gh-aw/agent/integrity/chart_reasons.py`: ```python #!/usr/bin/env python3 @@ -376,7 +376,7 @@ import json, os import matplotlib.pyplot as plt import seaborn as sns -DATA_DIR = "/tmp/gh-aw/integrity" +DATA_DIR = "/tmp/gh-aw/agent/integrity" CHARTS_DIR = f"{DATA_DIR}/charts" os.makedirs(CHARTS_DIR, exist_ok=True) @@ -423,14 +423,14 @@ plt.savefig(f"{CHARTS_DIR}/reasons_tags.png", dpi=300, bbox_inches="tight", face print("Chart 5 saved.") ``` -Run: `python3 /tmp/gh-aw/integrity/chart_reasons.py` +Run: `python3 /tmp/gh-aw/agent/integrity/chart_reasons.py` ### Upload DIFC Charts Upload each generated DIFC chart using the `upload asset` tool and collect the returned URLs: -1. Upload `/tmp/gh-aw/integrity/charts/events_timeline.png` -2. Upload `/tmp/gh-aw/integrity/charts/top_tools.png` -3. Upload `/tmp/gh-aw/integrity/charts/reasons_tags.png` +1. Upload `/tmp/gh-aw/agent/integrity/charts/events_timeline.png` +2. Upload `/tmp/gh-aw/agent/integrity/charts/top_tools.png` +3. Upload `/tmp/gh-aw/agent/integrity/charts/reasons_tags.png` --- diff --git a/.github/workflows/daily-security-red-team.md b/.github/workflows/daily-security-red-team.md index 0333dcd8fd8..3ee6f9a0b90 100644 --- a/.github/workflows/daily-security-red-team.md +++ b/.github/workflows/daily-security-red-team.md @@ -242,8 +242,8 @@ if [ "$IS_FULL_SCAN" = "true" ]; then echo "📁 Full scan: analyzing all files in $JS_DIR and $SH_DIR" # Get all files - find "$JS_DIR" -name "*.cjs" > /tmp/files-to-scan.txt - find "$SH_DIR" -name "*.sh" >> /tmp/files-to-scan.txt + find "$JS_DIR" -name "*.cjs" > /tmp/gh-aw/agent/files-to-scan.txt + find "$SH_DIR" -name "*.sh" >> /tmp/gh-aw/agent/files-to-scan.txt else echo "📁 Incremental scan: analyzing files changed in last 24 hours" @@ -253,19 +253,19 @@ else # Get files changed in last 24 hours git log --since="24 hours ago" --name-only --pretty=format: -- "$JS_DIR" "$SH_DIR" | \ - grep -E '\.(cjs|sh)$' | sort | uniq > /tmp/files-to-scan.txt + grep -E '\.(cjs|sh)$' | sort | uniq > /tmp/gh-aw/agent/files-to-scan.txt # If no changes, scan a random subset for proactive monitoring - if [ ! -s /tmp/files-to-scan.txt ]; then + if [ ! -s /tmp/gh-aw/agent/files-to-scan.txt ]; then echo "⚠️ No changes in last 24h, scanning random sample" - find "$JS_DIR" -name "*.cjs" | shuf -n 5 > /tmp/files-to-scan.txt - find "$SH_DIR" -name "*.sh" | shuf -n 3 >> /tmp/files-to-scan.txt + find "$JS_DIR" -name "*.cjs" | shuf -n 5 > /tmp/gh-aw/agent/files-to-scan.txt + find "$SH_DIR" -name "*.sh" | shuf -n 3 >> /tmp/gh-aw/agent/files-to-scan.txt fi fi -FILE_COUNT=$(wc -l < /tmp/files-to-scan.txt) +FILE_COUNT=$(wc -l < /tmp/gh-aw/agent/files-to-scan.txt) echo "📊 Files to scan: $FILE_COUNT" -cat /tmp/files-to-scan.txt +cat /tmp/gh-aw/agent/files-to-scan.txt # Update current scan with file count jq ".files_analyzed = $FILE_COUNT" "$CURRENT_SCAN" > "${CURRENT_SCAN}.tmp" @@ -293,42 +293,42 @@ while IFS= read -r file; do echo "Analyzing: $file" # Pattern 1: Secret exfiltration - if grep -nE '(process\.env\.|os\.getenv|ENV\[)[^;]*\.(post|fetch|axios|request|curl|wget)' "$file" > /tmp/pattern.txt; then + if grep -nE '(process\.env\.|os\.getenv|ENV\[)[^;]*\.(post|fetch|axios|request|curl|wget)' "$file" > /tmp/gh-aw/agent/pattern.txt; then echo "⚠️ Potential secret exfiltration in $file" - FINDINGS+=("SECRET_EXFIL:$file:$(head -1 /tmp/pattern.txt | cut -d: -f1)") + FINDINGS+=("SECRET_EXFIL:$file:$(head -1 /tmp/gh-aw/agent/pattern.txt | cut -d: -f1)") fi # Pattern 2: Eval/exec with user input - if grep -nE '(eval|exec|Function)\s*\([^)]*(\$\{|process\.env|user|input|github\.)' "$file" > /tmp/pattern.txt; then + if grep -nE '(eval|exec|Function)\s*\([^)]*(\$\{|process\.env|user|input|github\.)' "$file" > /tmp/gh-aw/agent/pattern.txt; then echo "⚠️ Dynamic code execution with external input in $file" - FINDINGS+=("DYNAMIC_EXEC:$file:$(head -1 /tmp/pattern.txt | cut -d: -f1)") + FINDINGS+=("DYNAMIC_EXEC:$file:$(head -1 /tmp/gh-aw/agent/pattern.txt | cut -d: -f1)") fi # Pattern 3: Obfuscated strings - if grep -nE '(atob|btoa|Buffer\.from.*base64|String\.fromCharCode|\\x[0-9a-f]{2}.*\\x[0-9a-f]{2}.*\\x[0-9a-f]{2})' "$file" > /tmp/pattern.txt; then + if grep -nE '(atob|btoa|Buffer\.from.*base64|String\.fromCharCode|\\x[0-9a-f]{2}.*\\x[0-9a-f]{2}.*\\x[0-9a-f]{2})' "$file" > /tmp/gh-aw/agent/pattern.txt; then echo "⚠️ Obfuscated content in $file" - FINDINGS+=("OBFUSCATION:$file:$(head -1 /tmp/pattern.txt | cut -d: -f1)") + FINDINGS+=("OBFUSCATION:$file:$(head -1 /tmp/gh-aw/agent/pattern.txt | cut -d: -f1)") fi # Pattern 4: Suspicious file operations - if grep -nE '(rm\s+-rf|unlink.*\$|fs\.rmdir|fs\.unlink).*(\$\{|process\.env|user|input)' "$file" > /tmp/pattern.txt; then + if grep -nE '(rm\s+-rf|unlink.*\$|fs\.rmdir|fs\.unlink).*(\$\{|process\.env|user|input)' "$file" > /tmp/gh-aw/agent/pattern.txt; then echo "⚠️ Dangerous file operations in $file" - FINDINGS+=("DANGEROUS_OPS:$file:$(head -1 /tmp/pattern.txt | cut -d: -f1)") + FINDINGS+=("DANGEROUS_OPS:$file:$(head -1 /tmp/gh-aw/agent/pattern.txt | cut -d: -f1)") fi # Pattern 5: Network calls to suspicious domains - if grep -nE '(http://|https://)[^/]*(\.ru|\.cn|\.tk|pastebin|hastebin|ngrok|localtunnel)' "$file" > /tmp/pattern.txt; then + if grep -nE '(http://|https://)[^/]*(\.ru|\.cn|\.tk|pastebin|hastebin|ngrok|localtunnel)' "$file" > /tmp/gh-aw/agent/pattern.txt; then echo "⚠️ Suspicious network domain in $file" - FINDINGS+=("SUSPICIOUS_DOMAIN:$file:$(head -1 /tmp/pattern.txt | cut -d: -f1)") + FINDINGS+=("SUSPICIOUS_DOMAIN:$file:$(head -1 /tmp/gh-aw/agent/pattern.txt | cut -d: -f1)") fi # Pattern 6: Backdoor keywords - if grep -niE '(backdoor|malware|rootkit|keylog|ransomware|trojan|c2|command.?and.?control)' "$file" > /tmp/pattern.txt; then + if grep -niE '(backdoor|malware|rootkit|keylog|ransomware|trojan|c2|command.?and.?control)' "$file" > /tmp/gh-aw/agent/pattern.txt; then echo "⚠️ Suspicious keywords in $file" - FINDINGS+=("SUSPICIOUS_KEYWORDS:$file:$(head -1 /tmp/pattern.txt | cut -d: -f1)") + FINDINGS+=("SUSPICIOUS_KEYWORDS:$file:$(head -1 /tmp/gh-aw/agent/pattern.txt | cut -d: -f1)") fi -done < /tmp/files-to-scan.txt +done < /tmp/gh-aw/agent/files-to-scan.txt echo "✅ Pattern analysis complete: ${#FINDINGS[@]} findings" ``` @@ -358,18 +358,18 @@ while IFS= read -r file; do fi # Pattern: Suspicious function names - if grep -nE 'function\s+(hack|pwn|exploit|backdoor|inject|payload)' "$file" > /tmp/ast.txt; then + if grep -nE 'function\s+(hack|pwn|exploit|backdoor|inject|payload)' "$file" > /tmp/gh-aw/agent/ast.txt; then echo "⚠️ Suspicious function names in $file" - FINDINGS+=("SUSPICIOUS_NAMES:$file:$(head -1 /tmp/ast.txt | cut -d: -f1)") + FINDINGS+=("SUSPICIOUS_NAMES:$file:$(head -1 /tmp/gh-aw/agent/ast.txt | cut -d: -f1)") fi # Pattern: Unusual module.exports or global assignments - if grep -nE '(global\.|window\.|process\.)[a-zA-Z_$].*=.*require|module\.exports\s*=\s*require' "$file" > /tmp/ast.txt; then + if grep -nE '(global\.|window\.|process\.)[a-zA-Z_$].*=.*require|module\.exports\s*=\s*require' "$file" > /tmp/gh-aw/agent/ast.txt; then echo "⚠️ Suspicious global/export patterns in $file" - FINDINGS+=("SUSPICIOUS_EXPORTS:$file:$(head -1 /tmp/ast.txt | cut -d: -f1)") + FINDINGS+=("SUSPICIOUS_EXPORTS:$file:$(head -1 /tmp/gh-aw/agent/ast.txt | cut -d: -f1)") fi fi -done < /tmp/files-to-scan.txt +done < /tmp/gh-aw/agent/files-to-scan.txt echo "✅ AST inspection complete" ``` @@ -419,7 +419,7 @@ while IFS= read -r file; do FINDINGS+=("LONG_ENCODED:$file:0") fi -done < /tmp/files-to-scan.txt +done < /tmp/gh-aw/agent/files-to-scan.txt echo "✅ Entropy analysis complete" ``` @@ -439,25 +439,25 @@ while IFS= read -r file; do echo "Analyzing network patterns: $file" # Extract all URLs/domains - grep -oE '(http|https|ftp)://[a-zA-Z0-9./?=_-]*' "$file" > /tmp/urls.txt || true + grep -oE '(http|https|ftp)://[a-zA-Z0-9./?=_-]*' "$file" > /tmp/gh-aw/agent/urls.txt || true - if [ -s /tmp/urls.txt ]; then + if [ -s /tmp/gh-aw/agent/urls.txt ]; then while IFS= read -r url; do # Check if URL is to unexpected domains if ! echo "$url" | grep -qE '(github\.com|githubusercontent\.com|microsoft\.com|npmjs\.org|api\.github\.com)'; then echo "⚠️ External network call to $url in $file" FINDINGS+=("EXTERNAL_NETWORK:$file:0:url=$url") fi - done < /tmp/urls.txt + done < /tmp/gh-aw/agent/urls.txt fi # Check for IP addresses (often suspicious) - if grep -nE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' "$file" > /tmp/ips.txt; then + if grep -nE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' "$file" > /tmp/gh-aw/agent/ips.txt; then echo "⚠️ Hardcoded IP addresses in $file" - FINDINGS+=("HARDCODED_IP:$file:$(head -1 /tmp/ips.txt | cut -d: -f1)") + FINDINGS+=("HARDCODED_IP:$file:$(head -1 /tmp/gh-aw/agent/ips.txt | cut -d: -f1)") fi -done < /tmp/files-to-scan.txt +done < /tmp/gh-aw/agent/files-to-scan.txt echo "✅ Network analysis complete" ``` @@ -477,26 +477,26 @@ while IFS= read -r file; do echo "Analyzing behavior: $file" # Check for time-based logic (time bombs) - if grep -nE '(new Date\(\)|Date\.now\(\)|getTime\(\)).*[<>]=?\s*[0-9]' "$file" > /tmp/time.txt; then + if grep -nE '(new Date\(\)|Date\.now\(\)|getTime\(\)).*[<>]=?\s*[0-9]' "$file" > /tmp/gh-aw/agent/time.txt; then if grep -E '(if|while).*Date' "$file" | grep -qE '(exit|throw|delete|destroy)'; then echo "⚠️ Time-based conditional with destructive action in $file" - FINDINGS+=("TIME_BOMB:$file:$(head -1 /tmp/time.txt | cut -d: -f1)") + FINDINGS+=("TIME_BOMB:$file:$(head -1 /tmp/gh-aw/agent/time.txt | cut -d: -f1)") fi fi # Check for persistence mechanisms - if grep -nE '(cron|setInterval|setTimeout.*[0-9]{6,}|while.*true)' "$file" > /tmp/persist.txt; then + if grep -nE '(cron|setInterval|setTimeout.*[0-9]{6,}|while.*true)' "$file" > /tmp/gh-aw/agent/persist.txt; then echo "⚠️ Persistence mechanism in $file" - FINDINGS+=("PERSISTENCE:$file:$(head -1 /tmp/persist.txt | cut -d: -f1)") + FINDINGS+=("PERSISTENCE:$file:$(head -1 /tmp/gh-aw/agent/persist.txt | cut -d: -f1)") fi # Check for anti-debugging - if grep -nE '(debugger|isDebugger|chrome|devtools)' "$file" > /tmp/debug.txt; then + if grep -nE '(debugger|isDebugger|chrome|devtools)' "$file" > /tmp/gh-aw/agent/debug.txt; then echo "⚠️ Anti-debugging code in $file" - FINDINGS+=("ANTI_DEBUG:$file:$(head -1 /tmp/debug.txt | cut -d: -f1)") + FINDINGS+=("ANTI_DEBUG:$file:$(head -1 /tmp/gh-aw/agent/debug.txt | cut -d: -f1)") fi -done < /tmp/files-to-scan.txt +done < /tmp/gh-aw/agent/files-to-scan.txt echo "✅ Behavioral analysis complete" ``` @@ -525,12 +525,12 @@ fi while IFS= read -r file; do if [[ "$file" == *.cjs ]]; then # Check for requires to unusual paths - if grep -nE 'require\(["\x27]\.\.\/\.\.\/\.\.\/' "$file" > /tmp/require.txt; then + if grep -nE 'require\(["\x27]\.\.\/\.\.\/\.\.\/' "$file" > /tmp/gh-aw/agent/require.txt; then echo "⚠️ Suspicious require path traversal in $file" - FINDINGS+=("PATH_TRAVERSAL:$file:$(head -1 /tmp/require.txt | cut -d: -f1)") + FINDINGS+=("PATH_TRAVERSAL:$file:$(head -1 /tmp/gh-aw/agent/require.txt | cut -d: -f1)") fi fi -done < /tmp/files-to-scan.txt +done < /tmp/gh-aw/agent/files-to-scan.txt echo "✅ Dependency audit complete" ``` @@ -627,7 +627,7 @@ if [ ${#FINDINGS[@]} -gt 0 ]; then echo "Creating security issue with actionable tasks..." # Create issue using safe-outputs - cat > /tmp/security-issue.md < /tmp/gh-aw/agent/security-issue.md <&1 | tee /tmp/sentrux-check.txt || true +sentrux check . 2>&1 | tee /tmp/gh-aw/agent/sentrux-check.txt || true # Save a gate baseline for comparison in future runs -sentrux gate --save . 2>&1 | tee /tmp/sentrux-gate.txt || true +sentrux gate --save . 2>&1 | tee /tmp/gh-aw/agent/sentrux-gate.txt || true ``` Parse the output to extract: diff --git a/.github/workflows/daily-skill-optimizer.md b/.github/workflows/daily-skill-optimizer.md index 0eb90bd7589..b6fa1d221c2 100644 --- a/.github/workflows/daily-skill-optimizer.md +++ b/.github/workflows/daily-skill-optimizer.md @@ -56,7 +56,7 @@ jobs: run: | set -euo pipefail - RESULT_DIR="/tmp/gh-aw/skill-optimizer-results" + RESULT_DIR="/tmp/gh-aw/agent/skill-optimizer-results" TOOL_DIR="$RESULT_DIR/skill-optimizer-src" mkdir -p "$RESULT_DIR" @@ -121,7 +121,7 @@ jobs: uses: actions/upload-artifact@v7.0.1 with: name: skill-optimizer-results - path: /tmp/gh-aw/skill-optimizer-results + path: /tmp/gh-aw/agent/skill-optimizer-results if-no-files-found: error retention-days: 7 @@ -137,7 +137,7 @@ steps: uses: actions/download-artifact@v8.0.1 with: name: skill-optimizer-results - path: /tmp/gh-aw/skill-optimizer-results + path: /tmp/gh-aw/agent/skill-optimizer-results tools: cli-proxy: true @@ -155,8 +155,8 @@ You are a workflow quality analyst for `${{ github.repository }}`. ## Inputs -- Downloaded artifact directory: `/tmp/gh-aw/skill-optimizer-results` -- Required file: `/tmp/gh-aw/skill-optimizer-results/summary.json` +- Downloaded artifact directory: `/tmp/gh-aw/agent/skill-optimizer-results` +- Required file: `/tmp/gh-aw/agent/skill-optimizer-results/summary.json` - Optional logs: - `clone.log` - `npm-ci.log` diff --git a/.github/workflows/daily-syntax-error-quality.md b/.github/workflows/daily-syntax-error-quality.md index 5087e775dda..2f2cefcc016 100644 --- a/.github/workflows/daily-syntax-error-quality.md +++ b/.github/workflows/daily-syntax-error-quality.md @@ -15,11 +15,11 @@ tools: cli-proxy: true bash: - "gh aw compile *" - - "gh aw compile /tmp/gh-aw/syntax-error-tests/*.md" + - "gh aw compile /tmp/gh-aw/agent/syntax-error-tests/*.md" - "head -n 30 /tmp/gh-aw/agent/candidates/" - "cp /tmp/gh-aw/agent/candidates/" - - "cat /tmp/gh-aw/syntax-error-tests/*.md" - - "mkdir -p /tmp/gh-aw/syntax-error-tests" + - "cat /tmp/gh-aw/agent/syntax-error-tests/*.md" + - "mkdir -p /tmp/gh-aw/agent/syntax-error-tests" safe-outputs: create-issue: expires: 3d @@ -163,10 +163,10 @@ Examples: For each workflow: -1. **Copy workflow to /tmp** for testing: +1. **Copy workflow to `/tmp/gh-aw/agent`** for testing: ```bash - mkdir -p /tmp/gh-aw/syntax-error-tests - cp /tmp/gh-aw/agent/candidates/selected-workflow.md /tmp/gh-aw/syntax-error-tests/test-1.md + mkdir -p /tmp/gh-aw/agent/syntax-error-tests + cp /tmp/gh-aw/agent/candidates/selected-workflow.md /tmp/gh-aw/agent/syntax-error-tests/test-1.md ``` 2. **Introduce ONE error** from a different category: @@ -190,7 +190,7 @@ For each test case: 1. **Attempt to compile** the modified workflow: ```bash - cd /tmp/gh-aw/syntax-error-tests + cd /tmp/gh-aw/agent/syntax-error-tests gh aw compile test-1.md 2>&1 | tee test-1-output.txt ``` @@ -278,7 +278,7 @@ Suggested structure: 1. **Realistic Errors**: Introduce errors that developers actually make 2. **Diverse Coverage**: Test different error categories and workflows 3. **No False Positives**: Ensure the error we introduce is actually invalid -4. **Clean Workspace**: Use /tmp for test files, don't modify actual workflows +4. **Clean Workspace**: Use `/tmp/gh-aw/agent` for test files, don't modify actual workflows ### Evaluation Guidelines diff --git a/.github/workflows/daily-testify-uber-super-expert.md b/.github/workflows/daily-testify-uber-super-expert.md index 36069a3f7f0..eefd062e857 100644 --- a/.github/workflows/daily-testify-uber-super-expert.md +++ b/.github/workflows/daily-testify-uber-super-expert.md @@ -97,7 +97,7 @@ Find all Go test files and select one that hasn't been processed in the last 30 ```bash # Get all test files -find . -name '*_test.go' -type f > /tmp/all_test_files.txt +find . -name '*_test.go' -type f > /tmp/gh-aw/agent/all_test_files.txt # Filter out recently processed files (last 30 days) CUTOFF_DATE=$(date -d '30 days ago' '+%Y-%m-%d' 2>/dev/null || date -v-30d '+%Y-%m-%d') @@ -105,17 +105,17 @@ CUTOFF_DATE=$(date -d '30 days ago' '+%Y-%m-%d' 2>/dev/null || date -v-30d '+%Y- # Create list of candidate files (not processed or processed >30 days ago) while IFS='|' read -r filepath timestamp; do if [[ "$timestamp" < "$CUTOFF_DATE" ]]; then - echo "$filepath" >> /tmp/candidate_files.txt + echo "$filepath" >> /tmp/gh-aw/agent/candidate_files.txt fi done < "$CACHE_FILE" 2>/dev/null || true # If no cache or all files old, use all test files -if [ ! -f /tmp/candidate_files.txt ]; then - cp /tmp/all_test_files.txt /tmp/candidate_files.txt +if [ ! -f /tmp/gh-aw/agent/candidate_files.txt ]; then + cp /tmp/gh-aw/agent/all_test_files.txt /tmp/gh-aw/agent/candidate_files.txt fi # Select a random file from candidates -TARGET_FILE=$(shuf -n 1 /tmp/candidate_files.txt) +TARGET_FILE=$(shuf -n 1 /tmp/gh-aw/agent/candidate_files.txt) echo "Selected file: $TARGET_FILE" ``` diff --git a/.github/workflows/dataflow-pr-discussion-dataset.md b/.github/workflows/dataflow-pr-discussion-dataset.md index 4e98ff7c8f7..007a1b186d3 100644 --- a/.github/workflows/dataflow-pr-discussion-dataset.md +++ b/.github/workflows/dataflow-pr-discussion-dataset.md @@ -35,9 +35,9 @@ tools: steps: - name: Install DataFlow run: | - python3 -m venv /tmp/gh-aw/venv - /tmp/gh-aw/venv/bin/pip install --quiet open-dataflow - /tmp/gh-aw/venv/bin/python3 -c " + python3 -m venv /tmp/gh-aw/agent/venv + /tmp/gh-aw/agent/venv/bin/pip install --quiet open-dataflow + /tmp/gh-aw/agent/venv/bin/python3 -c " import dataflow print('DataFlow', getattr(dataflow, '__version__', 'installed'), 'ready') # Print available operators for reference @@ -45,7 +45,7 @@ steps: available = [m.name for m in pkgutil.iter_modules(ops.__path__)] print('Operator modules:', available) " - mkdir -p /tmp/gh-aw/dataflow/{input,output,pipeline,reports} + mkdir -p /tmp/gh-aw/agent/dataflow/{input,output,pipeline,reports} - name: Fetch merged PRs env: @@ -60,9 +60,9 @@ steps: --state merged \ --limit 500 \ --json number,title,body,createdAt,mergedAt,url,author,labels \ - > /tmp/gh-aw/dataflow/input/prs.json + > /tmp/gh-aw/agent/dataflow/input/prs.json - echo "Fetched $(jq 'length' /tmp/gh-aw/dataflow/input/prs.json) merged PRs" + echo "Fetched $(jq 'length' /tmp/gh-aw/agent/dataflow/input/prs.json) merged PRs" safe-outputs: upload-artifact: @@ -97,10 +97,10 @@ Build a cleaned, quality-scored, and deduplicated JSONL dataset from this reposi - **Repository**: ${{ github.repository }} - **Run ID**: ${{ github.run_id }} - **Data available**: - - Discussions: `/tmp/gh-aw/discussions-data/discussions.json` (pre-fetched by shared component) - - PRs: `/tmp/gh-aw/dataflow/input/prs.json` (pre-fetched in `steps:`) -- **DataFlow venv**: `/tmp/gh-aw/venv/bin/python3` -- **Output dir**: `/tmp/gh-aw/dataflow/output/` + - Discussions: `/tmp/gh-aw/agent/discussions-data/discussions.json` (pre-fetched by shared component) + - PRs: `/tmp/gh-aw/agent/dataflow/input/prs.json` (pre-fetched in `steps:`) +- **DataFlow venv**: `/tmp/gh-aw/agent/venv/bin/python3` +- **Output dir**: `/tmp/gh-aw/agent/dataflow/output/` ## Pipeline Overview @@ -137,7 +137,7 @@ GitHub Discussions + PRs Before building the pipeline, discover which operators are installed: ```bash -/tmp/gh-aw/venv/bin/python3 -c " +/tmp/gh-aw/agent/venv/bin/python3 -c " import pkgutil, dataflow.operators as ops for m in pkgutil.iter_modules(ops.__path__): print(m.name) @@ -147,7 +147,7 @@ for m in pkgutil.iter_modules(ops.__path__): Then list classes in the `filter` and `dedup` sub-modules (if present): ```bash -/tmp/gh-aw/venv/bin/python3 -c " +/tmp/gh-aw/agent/venv/bin/python3 -c " import inspect try: import dataflow.operators.filter as f @@ -170,7 +170,7 @@ Use the discovered class names throughout the pipeline below. Convert both discussions and PRs into a unified JSONL format with a `text` field that DataFlow operators will read. -Write a Python script `/tmp/gh-aw/dataflow/pipeline/01_normalise.py`: +Write a Python script `/tmp/gh-aw/agent/dataflow/pipeline/01_normalise.py`: ```python #!/usr/bin/env python3 @@ -180,11 +180,11 @@ import json import sys from pathlib import Path -OUT = Path("/tmp/gh-aw/dataflow/input/combined_raw.jsonl") +OUT = Path("/tmp/gh-aw/agent/dataflow/input/combined_raw.jsonl") records = [] # ── Discussions ─────────────────────────────────────────────────────────────── -disc_path = Path("/tmp/gh-aw/discussions-data/discussions.json") +disc_path = Path("/tmp/gh-aw/agent/discussions-data/discussions.json") if disc_path.exists(): discussions = json.loads(disc_path.read_text()) for d in discussions: @@ -206,7 +206,7 @@ if disc_path.exists(): print(f"Loaded {len(discussions)} discussions → {sum(1 for r in records if r['source']=='discussion')} with text") # ── Pull Requests ───────────────────────────────────────────────────────────── -pr_path = Path("/tmp/gh-aw/dataflow/input/prs.json") +pr_path = Path("/tmp/gh-aw/agent/dataflow/input/prs.json") if pr_path.exists(): prs = json.loads(pr_path.read_text()) pr_count_before = len(records) @@ -241,12 +241,12 @@ print(f"Total records written: {len(records)} → {OUT}") Run it: ```bash -/tmp/gh-aw/venv/bin/python3 /tmp/gh-aw/dataflow/pipeline/01_normalise.py +/tmp/gh-aw/agent/venv/bin/python3 /tmp/gh-aw/agent/dataflow/pipeline/01_normalise.py ``` ### Step 3: Build and Run the DataFlow Pipeline -Write `/tmp/gh-aw/dataflow/pipeline/02_pipeline.py`: +Write `/tmp/gh-aw/agent/dataflow/pipeline/02_pipeline.py`: ```python #!/usr/bin/env python3 @@ -262,11 +262,11 @@ DataFlow text processing pipeline: import json, sys, inspect, traceback from pathlib import Path -INPUT = "/tmp/gh-aw/dataflow/input/combined_raw.jsonl" -OUTPUT = "/tmp/gh-aw/dataflow/output/dataset_clean.jsonl" -STATS = "/tmp/gh-aw/dataflow/output/pipeline_stats.json" +INPUT = "/tmp/gh-aw/agent/dataflow/input/combined_raw.jsonl" +OUTPUT = "/tmp/gh-aw/agent/dataflow/output/dataset_clean.jsonl" +STATS = "/tmp/gh-aw/agent/dataflow/output/pipeline_stats.json" -Path("/tmp/gh-aw/dataflow/output").mkdir(parents=True, exist_ok=True) +Path("/tmp/gh-aw/agent/dataflow/output").mkdir(parents=True, exist_ok=True) # ── Load DataFlow storage ───────────────────────────────────────────────────── try: @@ -403,14 +403,14 @@ print(json.dumps(stats, indent=2)) Run it: ```bash -/tmp/gh-aw/venv/bin/python3 /tmp/gh-aw/dataflow/pipeline/02_pipeline.py +/tmp/gh-aw/agent/venv/bin/python3 /tmp/gh-aw/agent/dataflow/pipeline/02_pipeline.py ``` Verify output: ```bash -echo "Output records: $(wc -l < /tmp/gh-aw/dataflow/output/dataset_clean.jsonl)" -cat /tmp/gh-aw/dataflow/output/pipeline_stats.json +echo "Output records: $(wc -l < /tmp/gh-aw/agent/dataflow/output/dataset_clean.jsonl)" +cat /tmp/gh-aw/agent/dataflow/output/pipeline_stats.json ``` ### Step 4: Upload Dataset Artifact @@ -420,7 +420,7 @@ Stage the output file and upload it as a workflow artifact: ```bash # Stage for upload mkdir -p "$RUNNER_TEMP/gh-aw/safeoutputs/upload-artifacts" -cp /tmp/gh-aw/dataflow/output/dataset_clean.jsonl \ +cp /tmp/gh-aw/agent/dataflow/output/dataset_clean.jsonl \ "$RUNNER_TEMP/gh-aw/safeoutputs/upload-artifacts/dataset_clean.jsonl" ``` @@ -442,7 +442,7 @@ Save pipeline statistics for trend tracking across runs: ```bash DATE=$(date '+%Y-%m-%d') RUN_ID="${GITHUB_RUN_ID}" -STATS=$(cat /tmp/gh-aw/dataflow/output/pipeline_stats.json) +STATS=$(cat /tmp/gh-aw/agent/dataflow/output/pipeline_stats.json) # Load existing history (or start fresh) HISTORY_FILE="/tmp/gh-aw/repo-memory/default/dataflow-runs.jsonl" @@ -468,13 +468,13 @@ print('Run appended to history') Read the clean output and compute a per-source breakdown: ```bash -/tmp/gh-aw/venv/bin/python3 - << 'EOF' +/tmp/gh-aw/agent/venv/bin/python3 - << 'EOF' import json from collections import Counter from pathlib import Path -records = [json.loads(l) for l in open("/tmp/gh-aw/dataflow/output/dataset_clean.jsonl")] -stats = json.loads(Path("/tmp/gh-aw/dataflow/output/pipeline_stats.json").read_text()) +records = [json.loads(l) for l in open("/tmp/gh-aw/agent/dataflow/output/dataset_clean.jsonl")] +stats = json.loads(Path("/tmp/gh-aw/agent/dataflow/output/pipeline_stats.json").read_text()) by_source = Counter(r.get("source", "unknown") for r in records) avg_len = sum(len(r.get("text", "")) for r in records) / max(len(records), 1) @@ -488,7 +488,7 @@ report = { "retention_rate_pct": round(len(records) / max(stats.get("input_count", 1), 1) * 100, 1), } -Path("/tmp/gh-aw/dataflow/reports/quality_breakdown.json").write_text(json.dumps(report, indent=2)) +Path("/tmp/gh-aw/agent/dataflow/reports/quality_breakdown.json").write_text(json.dumps(report, indent=2)) print(json.dumps(report, indent=2)) EOF ``` @@ -503,8 +503,8 @@ Read the quality breakdown and artifact URL from files, then construct the discu import json from pathlib import Path -quality = json.loads(Path("/tmp/gh-aw/dataflow/reports/quality_breakdown.json").read_text()) -stats = json.loads(Path("/tmp/gh-aw/dataflow/output/pipeline_stats.json").read_text()) +quality = json.loads(Path("/tmp/gh-aw/agent/dataflow/reports/quality_breakdown.json").read_text()) +stats = json.loads(Path("/tmp/gh-aw/agent/dataflow/output/pipeline_stats.json").read_text()) # Read artifact URL saved after upload_artifact call artifact_url = "" diff --git a/.github/workflows/deep-report.md b/.github/workflows/deep-report.md index fd0ef25e27b..61ecc64d188 100644 --- a/.github/workflows/deep-report.md +++ b/.github/workflows/deep-report.md @@ -107,7 +107,7 @@ Analyze recent discussions in this repository, focusing on: - **Report** discussions (category: reports) - Various agent analysis reports - **General** discussions - Other agent outputs -Pre-fetched discussions data is available at `/tmp/gh-aw/discussions-data/discussions.json` (populated by the discussions-data-fetch step). Use this file as the primary source for discussion analysis. +Pre-fetched discussions data is available at `/tmp/gh-aw/agent/discussions-data/discussions.json` (populated by the discussions-data-fetch step). Use this file as the primary source for discussion analysis. ### Secondary: Workflow Logs @@ -119,7 +119,7 @@ Use the gh-aw MCP server to access workflow execution logs: ### Tertiary: Repository Issues -Pre-fetched issues data from the last 7 days is available at `/tmp/gh-aw/weekly-issues-data/issues.json`. +Pre-fetched issues data from the last 7 days is available at `/tmp/gh-aw/agent/weekly-issues-data/issues.json`. Use this data to: - Analyze recent issue activity and trends @@ -150,16 +150,16 @@ Use this data to: **Example jq queries:** ```bash # Count total issues -jq 'length' /tmp/gh-aw/weekly-issues-data/issues.json +jq 'length' /tmp/gh-aw/agent/weekly-issues-data/issues.json # Get open issues -jq '[.[] | select(.state == "OPEN")]' /tmp/gh-aw/weekly-issues-data/issues.json +jq '[.[] | select(.state == "OPEN")]' /tmp/gh-aw/agent/weekly-issues-data/issues.json # Count by state -jq 'group_by(.state) | map({state: .[0].state, count: length})' /tmp/gh-aw/weekly-issues-data/issues.json +jq 'group_by(.state) | map({state: .[0].state, count: length})' /tmp/gh-aw/agent/weekly-issues-data/issues.json # Get unique authors -jq '[.[].author.login] | unique' /tmp/gh-aw/weekly-issues-data/issues.json +jq '[.[].author.login] | unique' /tmp/gh-aw/agent/weekly-issues-data/issues.json ``` ## Intelligence Collection Process @@ -179,7 +179,7 @@ jq '[.[].author.login] | unique' /tmp/gh-aw/weekly-issues-data/issues.json ### Step 1: Gather Discussion Intelligence -1. Load discussions from the pre-fetched data file at `/tmp/gh-aw/discussions-data/discussions.json` +1. Load discussions from the pre-fetched data file at `/tmp/gh-aw/agent/discussions-data/discussions.json` 2. Filter for discussions from the past 7 days using the `createdAt` or `updatedAt` fields 3. For each discussion: - Extract key metrics and findings @@ -194,17 +194,17 @@ jq '[.[].author.login] | unique' /tmp/gh-aw/weekly-issues-data/issues.json **Example jq queries:** ```bash # Get all discussions -jq 'length' /tmp/gh-aw/discussions-data/discussions.json +jq 'length' /tmp/gh-aw/agent/discussions-data/discussions.json # Get discussions from the past 7 days DATE_7_DAYS_AGO=$(date -d '7 days ago' '+%Y-%m-%dT%H:%M:%SZ' 2>/dev/null || date -v-7d '+%Y-%m-%dT%H:%M:%SZ') -jq --arg date "$DATE_7_DAYS_AGO" '[.[] | select(.updatedAt >= $date)]' /tmp/gh-aw/discussions-data/discussions.json +jq --arg date "$DATE_7_DAYS_AGO" '[.[] | select(.updatedAt >= $date)]' /tmp/gh-aw/agent/discussions-data/discussions.json # Get discussions by category slug (e.g. "reports", "audits", "daily-news") -jq '[.[] | select(.categorySlug == "reports")]' /tmp/gh-aw/discussions-data/discussions.json +jq '[.[] | select(.categorySlug == "reports")]' /tmp/gh-aw/agent/discussions-data/discussions.json # Get AI-generated discussions only -jq '[.[] | select(.isAgenticWorkflow == true)]' /tmp/gh-aw/discussions-data/discussions.json +jq '[.[] | select(.isAgenticWorkflow == true)]' /tmp/gh-aw/agent/discussions-data/discussions.json ``` ### Step 2: Gather Workflow Intelligence @@ -220,7 +220,7 @@ Use the gh-aw `logs` tool to: ### Step 2.5: Analyze Repository Issues Load and analyze the pre-fetched issues data: -1. Read `/tmp/gh-aw/weekly-issues-data/issues.json` +1. Read `/tmp/gh-aw/agent/weekly-issues-data/issues.json` 2. Analyze: - Issue creation/closure trends over the week - Most common labels and categories diff --git a/.github/workflows/docs-noob-tester.md b/.github/workflows/docs-noob-tester.md index 99877a7e7e6..8b21c182624 100644 --- a/.github/workflows/docs-noob-tester.md +++ b/.github/workflows/docs-noob-tester.md @@ -45,9 +45,9 @@ pre-agent-steps: EXPR_GITHUB_WORKSPACE: ${{ github.workspace }} run: | cd "$EXPR_GITHUB_WORKSPACE" - nohup make dev-docs > /tmp/preview.log 2>&1 & + nohup make dev-docs > /tmp/gh-aw/agent/preview.log 2>&1 & PID=$! - echo $PID > /tmp/server.pid + echo $PID > /tmp/gh-aw/agent/server.pid echo "Server PID: $PID" - name: Wait for server readiness run: | @@ -55,15 +55,15 @@ pre-agent-steps: WAITED=0 until (echo > /dev/tcp/127.0.0.1/4321) > /dev/null 2>&1; do # Check if the server process has already died - if [ -f /tmp/server.pid ] && ! kill -0 "$(cat /tmp/server.pid)" 2>/dev/null; then + if [ -f /tmp/gh-aw/agent/server.pid ] && ! kill -0 "$(cat /tmp/gh-aw/agent/server.pid)" 2>/dev/null; then echo "::error::Documentation server process died before opening port 4321. Server log:" - cat /tmp/preview.log + cat /tmp/gh-aw/agent/preview.log exit 1 fi WAITED=$((WAITED + 3)) if [ $WAITED -ge $MAX_WAIT ]; then echo "::error::Documentation server port 4321 did not open after ${MAX_WAIT}s. Server log:" - cat /tmp/preview.log + cat /tmp/gh-aw/agent/preview.log exit 1 fi echo "Waiting for docs port... ($WAITED/${MAX_WAIT}s)" @@ -72,15 +72,15 @@ pre-agent-steps: WAITED=0 until curl -sf http://localhost:4321/gh-aw/ > /dev/null 2>&1; do # Check if the server process has already died - if [ -f /tmp/server.pid ] && ! kill -0 "$(cat /tmp/server.pid)" 2>/dev/null; then + if [ -f /tmp/gh-aw/agent/server.pid ] && ! kill -0 "$(cat /tmp/gh-aw/agent/server.pid)" 2>/dev/null; then echo "::error::Documentation server process died before becoming ready. Server log:" - cat /tmp/preview.log + cat /tmp/gh-aw/agent/preview.log exit 1 fi WAITED=$((WAITED + 3)) if [ $WAITED -ge $MAX_WAIT ]; then echo "::error::Documentation server did not start after ${MAX_WAIT}s. Server log:" - cat /tmp/preview.log + cat /tmp/gh-aw/agent/preview.log exit 1 fi echo "Waiting for server... ($WAITED/${MAX_WAIT}s)" @@ -127,11 +127,11 @@ Using Playwright, visit exactly these 3 pages and stop: Before taking screenshots, create the screenshots directory: ```bash -mkdir -p /tmp/gh-aw/screenshots +mkdir -p /tmp/gh-aw/agent/screenshots ``` 1. **Visit the home page** (`http://localhost:4321/gh-aw/`) - - Take a screenshot: `playwright-cli browser_navigate --url "http://localhost:4321/gh-aw/" && playwright-cli browser_take_screenshot --filename /tmp/gh-aw/screenshots/home.png` + - Take a screenshot: `playwright-cli browser_navigate --url "http://localhost:4321/gh-aw/" && playwright-cli browser_take_screenshot --filename /tmp/gh-aw/agent/screenshots/home.png` - Note: Is it immediately clear what this tool does? - Note: Can you quickly find the "Get Started" or "Quick Start" link? @@ -182,9 +182,9 @@ As you navigate, specifically look for: For each confusing or broken area: - Take a screenshot showing the issue -- Save it to a descriptive filename (e.g., "confusing-quick-start-step-3.png") in `/tmp/gh-aw/screenshots/` +- Save it to a descriptive filename (e.g., "confusing-quick-start-step-3.png") in `/tmp/gh-aw/agent/screenshots/` - Note the page URL and specific section -- Upload the screenshot by calling the `upload_asset` safe-output tool with the absolute file path `path: "/tmp/gh-aw/screenshots/.png"`. +- Upload the screenshot by calling the `upload_asset` safe-output tool with the absolute file path `path: "/tmp/gh-aw/agent/screenshots/.png"`. Record the returned asset URL. ## Step 4: Create Discussion Report diff --git a/.github/workflows/firewall-escape.md b/.github/workflows/firewall-escape.md index 43e4478cf94..7125cd4bb7a 100644 --- a/.github/workflows/firewall-escape.md +++ b/.github/workflows/firewall-escape.md @@ -156,16 +156,16 @@ rm $HOME/.firewall-test-marker **Expected:** SUCCESS - File write and cleanup in home directory should work. -## Test 7: File Write (/tmp) +## Test 7: File Write (`/tmp/gh-aw/agent`) Run: ```bash -echo "tmp-test-$(date +%s)" > /tmp/firewall-test-marker -cat /tmp/firewall-test-marker -rm /tmp/firewall-test-marker +echo "tmp-test-$(date +%s)" > /tmp/gh-aw/agent/firewall-test-marker +cat /tmp/gh-aw/agent/firewall-test-marker +rm /tmp/gh-aw/agent/firewall-test-marker ``` -**Expected:** SUCCESS - File write and cleanup in /tmp should work. +**Expected:** SUCCESS - File write and cleanup in `/tmp/gh-aw/agent` should work. ## Test 8: Localhost Connectivity diff --git a/.github/workflows/go-pattern-detector.md b/.github/workflows/go-pattern-detector.md index a1f599e7543..8e685516827 100644 --- a/.github/workflows/go-pattern-detector.md +++ b/.github/workflows/go-pattern-detector.md @@ -30,11 +30,11 @@ jobs: id: detect run: | # Run ast-grep to detect json:"-" pattern in Go files - if sg --pattern 'json:"-"' --lang go . > /tmp/ast-grep-results.txt 2>&1; then - if [ -s /tmp/ast-grep-results.txt ]; then + if sg --pattern 'json:"-"' --lang go . > /tmp/gh-aw/agent/ast-grep-results.txt 2>&1; then + if [ -s /tmp/gh-aw/agent/ast-grep-results.txt ]; then echo "found_patterns=true" >> "$GITHUB_OUTPUT" echo "::notice::Found Go patterns matching json:\"-\"" - cat /tmp/ast-grep-results.txt + cat /tmp/gh-aw/agent/ast-grep-results.txt else echo "found_patterns=false" >> "$GITHUB_OUTPUT" echo "::notice::No Go patterns matching json:\"-\" found" diff --git a/.github/workflows/gpclean.md b/.github/workflows/gpclean.md index 382fe8a0988..2a597fc626a 100644 --- a/.github/workflows/gpclean.md +++ b/.github/workflows/gpclean.md @@ -58,13 +58,13 @@ steps: -H "Accept: application/vnd.github+json" \ -H "X-GitHub-Api-Version: 2022-11-28" \ "/repos/$GITHUB_REPOSITORY/dependency-graph/sbom" \ - > /tmp/sbom.json + > /tmp/gh-aw/agent/sbom.json - echo "✅ SBOM downloaded successfully to /tmp/sbom.json" + echo "✅ SBOM downloaded successfully to /tmp/gh-aw/agent/sbom.json" # Show SBOM summary if command -v jq &> /dev/null; then - PACKAGE_COUNT=$(jq '.sbom.packages | length' /tmp/sbom.json 2>/dev/null || echo "unknown") + PACKAGE_COUNT=$(jq '.sbom.packages | length' /tmp/gh-aw/agent/sbom.json 2>/dev/null || echo "unknown") echo "📊 SBOM contains ${PACKAGE_COUNT} packages" fi @@ -88,10 +88,10 @@ Systematically detect Go dependencies that introduce non-MIT friendly (GPL-type) Use the repository's SBOM (Software Bill of Materials) to get accurate dependency information, then select one module to analyze in a round-robin fashion. -**IMPORTANT**: The SBOM has been pre-downloaded to `/tmp/sbom.json` in the frontmatter setup step. **Use this file directly** - do NOT try to download it again using curl or gh api (you do not have a GitHub token in the agent environment). +**IMPORTANT**: The SBOM has been pre-downloaded to `/tmp/gh-aw/agent/sbom.json` in the frontmatter setup step. **Use this file directly** - do NOT try to download it again using curl or gh api (you do not have a GitHub token in the agent environment). 1. **Use Pre-Downloaded SBOM**: - - The SBOM file is already available at `/tmp/sbom.json` + - The SBOM file is already available at `/tmp/gh-aw/agent/sbom.json` - It was downloaded using the GitHub Dependency Graph API with `contents: read` permission - Simply read and parse this file in subsequent steps @@ -101,14 +101,14 @@ Use the repository's SBOM (Software Bill of Materials) to get accurate dependenc - Filter for Go packages (those with `purl` starting with `pkg:golang/`) - Extract the package names (module paths) from the `purl` field - Focus on direct dependencies (not dev dependencies or build tools) - - Save the list of dependencies to `/tmp/go-dependencies.txt` + - Save the list of dependencies to `/tmp/gh-aw/agent/go-dependencies.txt` 3. **Load tracking state** from `/tmp/gh-aw/cache-memory/gpclean/state.json`: - If file doesn't exist, create it with initial state: `{"last_checked_module": "", "checked_modules": []}` - State tracks which modules have been checked recently 4. **Select next module to check**: - - Use the dependencies list from SBOM (`/tmp/go-dependencies.txt`) + - Use the dependencies list from SBOM (`/tmp/gh-aw/agent/go-dependencies.txt`) - Find the first module NOT in `checked_modules` list - If all modules have been checked, reset `checked_modules` to empty array and start over - Update state with selected module and save to cache-memory @@ -347,8 +347,8 @@ After creating the issue: ### SBOM Usage -- **SBOM is pre-downloaded** - The SBOM has been downloaded in the frontmatter setup step and is available at `/tmp/sbom.json` -- **Do NOT try to download SBOM again** - You do not have a GitHub token in the agent environment. Use the pre-downloaded file at `/tmp/sbom.json` +- **SBOM is pre-downloaded** - The SBOM has been downloaded in the frontmatter setup step and is available at `/tmp/gh-aw/agent/sbom.json` +- **Do NOT try to download SBOM again** - You do not have a GitHub token in the agent environment. Use the pre-downloaded file at `/tmp/gh-aw/agent/sbom.json` - SBOM is in SPDX format with packages listed in `sbom.packages[]` array - Go packages have `purl` (Package URL) in format: `pkg:golang/github.com/org/repo@version` - Parse the SBOM to extract all Go dependencies before license checking @@ -405,7 +405,7 @@ After creating the issue: ## Error Handling -- If the SBOM file `/tmp/sbom.json` is missing or corrupted, report the error and exit (this should not happen as it's pre-downloaded in frontmatter) +- If the SBOM file `/tmp/gh-aw/agent/sbom.json` is missing or corrupted, report the error and exit (this should not happen as it's pre-downloaded in frontmatter) - If `go mod graph` fails, report the error and exit - If license detection fails for a module, document it in the issue and recommend manual review - If no direct dependencies exist, exit successfully diff --git a/.github/workflows/issue-arborist.md b/.github/workflows/issue-arborist.md index cc2d7df346b..5aa14aea35b 100644 --- a/.github/workflows/issue-arborist.md +++ b/.github/workflows/issue-arborist.md @@ -28,7 +28,7 @@ tools: bash: - "cat *" - "jq *" - - "/tmp/gh-aw/jqschema.sh" + - "/tmp/gh-aw/agent/jqschema.sh" steps: - name: Fetch issues env: @@ -36,7 +36,7 @@ steps: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | # Create output directory - mkdir -p /tmp/gh-aw/issues-data + mkdir -p /tmp/gh-aw/agent/issues-data echo "⬇ Downloading the last 100 open issues (excluding sub-issues)..." @@ -47,17 +47,17 @@ steps: --state open \ --json number,title,author,createdAt,state,url,body,labels,updatedAt,closedAt,milestone,assignees \ --limit 100 \ - > /tmp/gh-aw/issues-data/issues.json + > /tmp/gh-aw/agent/issues-data/issues.json # Generate schema for reference using jqschema - /tmp/gh-aw/jqschema.sh < /tmp/gh-aw/issues-data/issues.json > /tmp/gh-aw/issues-data/issues-schema.json + /tmp/gh-aw/agent/jqschema.sh < /tmp/gh-aw/agent/issues-data/issues.json > /tmp/gh-aw/agent/issues-data/issues-schema.json - echo "✓ Issues data saved to /tmp/gh-aw/issues-data/issues.json" - echo "✓ Schema saved to /tmp/gh-aw/issues-data/issues-schema.json" - echo "Total issues fetched: $(jq 'length' /tmp/gh-aw/issues-data/issues.json)" + echo "✓ Issues data saved to /tmp/gh-aw/agent/issues-data/issues.json" + echo "✓ Schema saved to /tmp/gh-aw/agent/issues-data/issues-schema.json" + echo "Total issues fetched: $(jq 'length' /tmp/gh-aw/agent/issues-data/issues.json)" echo "" echo "Schema of the issues data:" - cat /tmp/gh-aw/issues-data/issues-schema.json | jq . + cat /tmp/gh-aw/agent/issues-data/issues-schema.json | jq . safe-outputs: create-issue: expires: 2d @@ -104,16 +104,16 @@ Analyze the last 100 open issues in repository $GITHUB_REPOSITORY (see `issues_a ## Pre-Downloaded Data The issue data has been pre-downloaded and is available at: -- **Issues data**: `/tmp/gh-aw/issues-data/issues.json` - Contains the last 100 open issues (excluding those that are already sub-issues) -- **Schema**: `/tmp/gh-aw/issues-data/issues-schema.json` - JSON schema showing the structure of the data +- **Issues data**: `/tmp/gh-aw/agent/issues-data/issues.json` - Contains the last 100 open issues (excluding those that are already sub-issues) +- **Schema**: `/tmp/gh-aw/agent/issues-data/issues-schema.json` - JSON schema showing the structure of the data -Use `cat /tmp/gh-aw/issues-data/issues.json | jq ...` to query and analyze the issues. +Use `cat /tmp/gh-aw/agent/issues-data/issues.json | jq ...` to query and analyze the issues. ## Process ### Step 1: Load and Analyze Issues -Read the pre-downloaded issues data from `/tmp/gh-aw/issues-data/issues.json`. The data includes: +Read the pre-downloaded issues data from `/tmp/gh-aw/agent/issues-data/issues.json`. The data includes: - Issue number - Title - Body/description @@ -124,13 +124,13 @@ Read the pre-downloaded issues data from `/tmp/gh-aw/issues-data/issues.json`. T Use `jq` to filter and analyze the data. Example queries: ```bash # Get count of issues -jq 'length' /tmp/gh-aw/issues-data/issues.json +jq 'length' /tmp/gh-aw/agent/issues-data/issues.json # Get open issues only -jq '[.[] | select(.state == "OPEN")]' /tmp/gh-aw/issues-data/issues.json +jq '[.[] | select(.state == "OPEN")]' /tmp/gh-aw/agent/issues-data/issues.json # Get issues with specific label -jq '[.[] | select(.labels | any(.name == "bug"))]' /tmp/gh-aw/issues-data/issues.json +jq '[.[] | select(.labels | any(.name == "bug"))]' /tmp/gh-aw/agent/issues-data/issues.json ``` ### Step 2: Analyze Relationships @@ -232,7 +232,7 @@ Your discussion should include: {{else}} # Issue Arborist 🌳 -You are the Issue Arborist. Pre-downloaded issue data is at `/tmp/gh-aw/issues-data/issues.json` (last 100 open issues). Your goal: +You are the Issue Arborist. Pre-downloaded issue data is at `/tmp/gh-aw/agent/issues-data/issues.json` (last 100 open issues). Your goal: 1. Use `jq` to identify clusters of 5+ related issues that share a theme but lack a parent. 2. Create a parent issue (title prefix `[Parent] `) for each cluster and link its members as sub-issues. diff --git a/.github/workflows/layout-spec-maintainer.md b/.github/workflows/layout-spec-maintainer.md index 81cd5fb1d79..39845d51c3f 100644 --- a/.github/workflows/layout-spec-maintainer.md +++ b/.github/workflows/layout-spec-maintainer.md @@ -24,7 +24,7 @@ safe-outputs: cache: - key: layout-spec-cache-${{ github.run_id }} name: Cache layout spec data - path: /tmp/gh-aw/layout-cache + path: /tmp/gh-aw/agent/layout-cache restore-keys: | layout-spec-cache- description: Maintains scratchpad/layout.md with patterns of file paths, folder names, and artifact names used in lock.yml files diff --git a/.github/workflows/mergefest.md b/.github/workflows/mergefest.md index add3e3cf2b8..8711b56968f 100644 --- a/.github/workflows/mergefest.md +++ b/.github/workflows/mergefest.md @@ -53,7 +53,7 @@ steps: git config user.email "github-actions[bot]@users.noreply.github.com" # Create .gitignore to exclude workflow YAML files - cat > /tmp/merge-gitignore << 'EOF' + cat > /tmp/gh-aw/agent/merge-gitignore << 'EOF' # Exclude all .yml files in .github/workflows/ .github/workflows/*.yml EOF diff --git a/.github/workflows/org-health-report.md b/.github/workflows/org-health-report.md index d24f42edeab..c6d3f3de64d 100644 --- a/.github/workflows/org-health-report.md +++ b/.github/workflows/org-health-report.md @@ -77,10 +77,10 @@ Generate an organization-wide health report that: Create working directories for data storage and processing: ```bash -mkdir -p /tmp/gh-aw/org-health -mkdir -p /tmp/gh-aw/org-health/repos -mkdir -p /tmp/gh-aw/org-health/issues -mkdir -p /tmp/gh-aw/org-health/prs +mkdir -p /tmp/gh-aw/agent/org-health +mkdir -p /tmp/gh-aw/agent/org-health/repos +mkdir -p /tmp/gh-aw/agent/org-health/issues +mkdir -p /tmp/gh-aw/agent/org-health/prs mkdir -p /tmp/gh-aw/python/data mkdir -p /tmp/gh-aw/cache-memory/org-health ``` @@ -93,17 +93,17 @@ mkdir -p /tmp/gh-aw/cache-memory/org-health - Query: `org:github archived:false` - Fetch repositories in batches with pagination - Add 2-3 second delays between pages to avoid rate limiting - - Save repository list to `/tmp/gh-aw/org-health/repos/repositories.json` + - Save repository list to `/tmp/gh-aw/agent/org-health/repos/repositories.json` 2. **Extract repository names** for subsequent queries: ```bash jq '[.[] | {name: .name, full_name: .full_name, stars: .stargazers_count, open_issues: .open_issues_count}]' \ - /tmp/gh-aw/org-health/repos/repositories.json > /tmp/gh-aw/org-health/repos/repo_list.json + /tmp/gh-aw/agent/org-health/repos/repositories.json > /tmp/gh-aw/agent/org-health/repos/repo_list.json ``` 3. **Log progress**: ```bash - echo "Found $(jq 'length' /tmp/gh-aw/org-health/repos/repo_list.json) public repositories" + echo "Found $(jq 'length' /tmp/gh-aw/agent/org-health/repos/repo_list.json) public repositories" ``` ### Phase 2: Collect Issues Data @@ -116,7 +116,7 @@ mkdir -p /tmp/gh-aw/cache-memory/org-health - Use the `search_issues` tool with query: `repo:github/{repo_name} is:issue` - Collect: state, created date, closed date, author, labels, assignees, comments count - Add **5 second delay** between repository queries - - Save to individual JSON files: `/tmp/gh-aw/org-health/issues/{repo_name}.json` + - Save to individual JSON files: `/tmp/gh-aw/agent/org-health/issues/{repo_name}.json` 2. **Alternative approach for large orgs**: Use organization-wide search: - Query: `org:github is:issue created:>=YYYY-MM-DD` for last 30 days @@ -125,7 +125,7 @@ mkdir -p /tmp/gh-aw/cache-memory/org-health 3. **Aggregate data**: ```bash - jq -s 'add' /tmp/gh-aw/org-health/issues/*.json > /tmp/gh-aw/org-health/all_issues.json + jq -s 'add' /tmp/gh-aw/agent/org-health/issues/*.json > /tmp/gh-aw/agent/org-health/all_issues.json ``` ### Phase 3: Collect Pull Requests Data @@ -138,7 +138,7 @@ mkdir -p /tmp/gh-aw/cache-memory/org-health - Use the `search_pull_requests` tool with query: `repo:github/{repo_name} is:pr` - Collect: state, created date, closed date, merged status, author, comments count - Add **5 second delay** between repository queries - - Save to individual JSON files: `/tmp/gh-aw/org-health/prs/{repo_name}.json` + - Save to individual JSON files: `/tmp/gh-aw/agent/org-health/prs/{repo_name}.json` 2. **Alternative approach for large orgs**: Use organization-wide search: - Query: `org:github is:pr created:>=YYYY-MM-DD` for last 30 days @@ -147,7 +147,7 @@ mkdir -p /tmp/gh-aw/cache-memory/org-health 3. **Aggregate data**: ```bash - jq -s 'add' /tmp/gh-aw/org-health/prs/*.json > /tmp/gh-aw/org-health/all_prs.json + jq -s 'add' /tmp/gh-aw/agent/org-health/prs/*.json > /tmp/gh-aw/agent/org-health/all_prs.json ``` ### Phase 4: Process and Analyze Data with Python @@ -168,10 +168,10 @@ from datetime import datetime, timedelta from collections import Counter # Load data -with open('/tmp/gh-aw/org-health/all_issues.json') as f: +with open('/tmp/gh-aw/agent/org-health/all_issues.json') as f: issues_data = json.load(f) -with open('/tmp/gh-aw/org-health/all_prs.json') as f: +with open('/tmp/gh-aw/agent/org-health/all_prs.json') as f: prs_data = json.load(f) # Convert to DataFrames diff --git a/.github/workflows/otlp-data-quality-validator.md b/.github/workflows/otlp-data-quality-validator.md index aba848a7090..1970724a406 100644 --- a/.github/workflows/otlp-data-quality-validator.md +++ b/.github/workflows/otlp-data-quality-validator.md @@ -45,7 +45,7 @@ gh-aw emits **traces only** (no metrics or logs). It sends OTLP spans **directly ```text gh-aw workflow runtime (actions/setup/js/send_otlp_span.cjs) - → local JSONL mirror (/tmp/gh-aw/otel.jsonl) + → local JSONL mirror (/tmp/gh-aw/agent/otel.jsonl) → OTLP/HTTP POST to vendor endpoints (concurrent fan-out) → vendor backends (Sentry, Grafana Tempo, Datadog, etc.) ``` @@ -53,7 +53,7 @@ gh-aw workflow runtime (actions/setup/js/send_otlp_span.cjs) Normative specification: `specs/otel-observability-spec.md` Use the cheapest trustworthy source first: -1. local JSONL mirror (`/tmp/gh-aw/otel.jsonl`) and export error logs (`/tmp/gh-aw/otlp-export-errors.jsonl`) +1. local JSONL mirror (`/tmp/gh-aw/agent/otel.jsonl`) and export error logs (`/tmp/gh-aw/agent/otlp-export-errors.jsonl`) 2. backend queries via MCP tools (when available) Always distinguish: @@ -75,11 +75,11 @@ Define and report: Infer expectations from: - local JSONL mirror span count - `github.run_id` from resource attributes -- export error count from `/tmp/gh-aw/otlp-export-errors.count` +- export error count from `/tmp/gh-aw/agent/otlp-export-errors.count` ### Step 2: Validate trace completeness and integrity -From the local JSONL mirror (`/tmp/gh-aw/otel.jsonl`), compute and report: +From the local JSONL mirror (`/tmp/gh-aw/agent/otel.jsonl`), compute and report: - unique `traceId` count (expect 1 per workflow run) - unique span identity count using `traceId + spanId` - duplicate spans with same `traceId + spanId` @@ -105,7 +105,7 @@ Flag timestamp issues: ```bash # Example: Extract span summary from JSONL mirror -jq -c '.resourceSpans[].scopeSpans[].spans[] | {name, traceId, spanId, parentSpanId, kind, status}' /tmp/gh-aw/otel.jsonl +jq -c '.resourceSpans[].scopeSpans[].spans[] | {name, traceId, spanId, parentSpanId, kind, status}' /tmp/gh-aw/agent/otel.jsonl ``` ### Step 3: Validate span attribute contract @@ -136,7 +136,7 @@ Check agent spans for GenAI semantic conventions (spec §10.3): ```bash # Example: Check required attributes on setup spans -jq -c '.resourceSpans[].scopeSpans[].spans[] | select(.name | endswith(".setup")) | {name, attrs: [.attributes[]? | {(.key): .value}] | add}' /tmp/gh-aw/otel.jsonl +jq -c '.resourceSpans[].scopeSpans[].spans[] | select(.name | endswith(".setup")) | {name, attrs: [.attributes[]? | {(.key): .value}] | add}' /tmp/gh-aw/agent/otel.jsonl ``` ### Step 4: Validate resource attributes @@ -155,7 +155,7 @@ Check instrumentation scope: ```bash # Example: Extract resource attributes -jq -c '.resourceSpans[].resource.attributes[] | {(.key): .value}' /tmp/gh-aw/otel.jsonl | sort -u +jq -c '.resourceSpans[].resource.attributes[] | {(.key): .value}' /tmp/gh-aw/agent/otel.jsonl | sort -u ``` ### Step 5: Validate trace ID propagation @@ -165,19 +165,19 @@ Verify trace ID consistency across jobs (spec §12): - setup spans across different jobs share the same global `parent_span_id` - the JSONL mirror `trace_id` matches the value in `GITHUB_AW_OTEL_TRACE_ID` -If export errors exist, check `/tmp/gh-aw/otlp-export-errors.jsonl`: +If export errors exist, check `/tmp/gh-aw/agent/otlp-export-errors.jsonl`: - which endpoints failed - HTTP status codes - whether failures are transient (retryable) or permanent ```bash # Example: Check trace ID consistency -jq -r '.resourceSpans[].scopeSpans[].spans[].traceId' /tmp/gh-aw/otel.jsonl | sort -u | wc -l +jq -r '.resourceSpans[].scopeSpans[].spans[].traceId' /tmp/gh-aw/agent/otel.jsonl | sort -u | wc -l # Expected: 1 (single trace ID per run) # Example: Check export errors -cat /tmp/gh-aw/otlp-export-errors.jsonl 2>/dev/null || echo "No export errors" -cat /tmp/gh-aw/otlp-export-errors.count 2>/dev/null || echo "0" +cat /tmp/gh-aw/agent/otlp-export-errors.jsonl 2>/dev/null || echo "No export errors" +cat /tmp/gh-aw/agent/otlp-export-errors.count 2>/dev/null || echo "0" ``` ### Step 6: Reconcile local mirror vs backend visibility diff --git a/.github/workflows/outcome-collector.md b/.github/workflows/outcome-collector.md index c33c757f2e0..2cd89032f61 100644 --- a/.github/workflows/outcome-collector.md +++ b/.github/workflows/outcome-collector.md @@ -53,7 +53,7 @@ pre-agent-steps: node "${RUNNER_TEMP}/gh-aw/actions/evaluate_outcomes.cjs" - name: Export outcome telemetry run: | - if [ -f /tmp/gh-aw/outcome-evaluations.jsonl ] && [ -s /tmp/gh-aw/outcome-evaluations.jsonl ]; then + if [ -f /tmp/gh-aw/agent/outcome-evaluations.jsonl ] && [ -s /tmp/gh-aw/agent/outcome-evaluations.jsonl ]; then node "${RUNNER_TEMP}/gh-aw/actions/emit_outcome_spans.cjs" else echo "No outcome evaluations to export" @@ -68,12 +68,12 @@ You are the Outcome Collector. Your job is to create a concise report of safe ou The pre-agent step has already evaluated outcomes for recent workflow runs. Results are in: -- `/tmp/gh-aw/outcome-summary.json` — fleet-wide summary -- `/tmp/gh-aw/outcomes/run-*.json` — per-run outcome details +- `/tmp/gh-aw/agent/outcome-summary.json` — fleet-wide summary +- `/tmp/gh-aw/agent/outcomes/run-*.json` — per-run outcome details ## Task -1. Read `/tmp/gh-aw/outcome-summary.json` +1. Read `/tmp/gh-aw/agent/outcome-summary.json` 2. If `total_outcomes` is 0, call `noop` with "No new safe output outcomes to report" 3. Otherwise, create a report issue with the summary diff --git a/.github/workflows/prompt-clustering-analysis.md b/.github/workflows/prompt-clustering-analysis.md index 3435fcdc0f2..87643c3dc7e 100644 --- a/.github/workflows/prompt-clustering-analysis.md +++ b/.github/workflows/prompt-clustering-analysis.md @@ -36,7 +36,7 @@ imports: cache: - key: prompt-clustering-cache-${{ github.run_id }} name: Cache prompt clustering data - path: /tmp/gh-aw/prompt-cache + path: /tmp/gh-aw/agent/prompt-cache restore-keys: | prompt-clustering-cache- @@ -51,16 +51,16 @@ steps: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | # Create output directory for full PR data - mkdir -p /tmp/gh-aw/prompt-cache/pr-full-data + mkdir -p /tmp/gh-aw/agent/prompt-cache/pr-full-data # Download full data for each PR including comments, reviews, commits, and files echo "Downloading full PR data for each PR..." - PR_COUNT=$(jq 'length' /tmp/gh-aw/pr-data/copilot-prs.json) + PR_COUNT=$(jq 'length' /tmp/gh-aw/agent/pr-data/copilot-prs.json) echo "Processing $PR_COUNT PRs..." # Extract PR numbers and download full data for each - jq -r '.[].number' /tmp/gh-aw/pr-data/copilot-prs.json | while read -r pr_number; do + jq -r '.[].number' /tmp/gh-aw/agent/pr-data/copilot-prs.json | while read -r pr_number; do echo "Downloading full data for PR #$pr_number..." # Download full PR data with essential fields only @@ -68,20 +68,20 @@ steps: if gh pr view "$pr_number" \ --repo "$GITHUB_REPOSITORY" \ --json number,title,body,state,createdAt,closedAt,mergedAt,url,comments,reviews,commits,changedFiles,additions,deletions,reviewDecision \ - > "/tmp/gh-aw/prompt-cache/pr-full-data/pr-${pr_number}.json" 2>"/tmp/gh-aw/prompt-cache/pr-full-data/pr-${pr_number}.err"; then + > "/tmp/gh-aw/agent/prompt-cache/pr-full-data/pr-${pr_number}.json" 2>"/tmp/gh-aw/agent/prompt-cache/pr-full-data/pr-${pr_number}.err"; then echo "Downloaded PR #$pr_number" else echo "Warning: Failed to download PR #$pr_number (skipping)" - rm -f "/tmp/gh-aw/prompt-cache/pr-full-data/pr-${pr_number}.json" "/tmp/gh-aw/prompt-cache/pr-full-data/pr-${pr_number}.err" + rm -f "/tmp/gh-aw/agent/prompt-cache/pr-full-data/pr-${pr_number}.json" "/tmp/gh-aw/agent/prompt-cache/pr-full-data/pr-${pr_number}.err" fi done # Create an index file listing all downloaded PRs - find /tmp/gh-aw/prompt-cache/pr-full-data/ -maxdepth 1 -name 'pr-[0-9]*.json' -type f -printf '%f\n' | \ - sed 's/pr-\([0-9]*\)\.json/\1/' | sort -n > /tmp/gh-aw/prompt-cache/pr-full-data/index.txt + find /tmp/gh-aw/agent/prompt-cache/pr-full-data/ -maxdepth 1 -name 'pr-[0-9]*.json' -type f -printf '%f\n' | \ + sed 's/pr-\([0-9]*\)\.json/\1/' | sort -n > /tmp/gh-aw/agent/prompt-cache/pr-full-data/index.txt - echo "Full PR data cached in /tmp/gh-aw/prompt-cache/pr-full-data/" - echo "Total PRs with full data: $(wc -l < /tmp/gh-aw/prompt-cache/pr-full-data/index.txt)" + echo "Full PR data cached in /tmp/gh-aw/agent/prompt-cache/pr-full-data/" + echo "Total PRs with full data: $(wc -l < /tmp/gh-aw/agent/prompt-cache/pr-full-data/index.txt)" - name: Download workflow logs for PR analysis env: @@ -89,17 +89,17 @@ steps: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | # Create logs directory - mkdir -p /tmp/gh-aw/workflow-logs + mkdir -p /tmp/gh-aw/agent/workflow-logs echo "Downloading workflow logs to extract turn counts..." # Download logs for the last 30 days of copilot workflows # This will give us the aw_info.json which contains turn counts - ./gh-aw logs --engine copilot --start-date -30d -o /tmp/gh-aw/workflow-logs + ./gh-aw logs --engine copilot --start-date -30d -o /tmp/gh-aw/agent/workflow-logs # Verify logs were downloaded echo "Downloaded workflow logs:" - find /tmp/gh-aw/workflow-logs -maxdepth 1 -ls + find /tmp/gh-aw/agent/workflow-logs -maxdepth 1 -ls timeout-minutes: 20 @@ -117,18 +117,18 @@ Daily analysis of copilot agent task prompts using clustering techniques to iden - **Repository**: $GITHUB_REPOSITORY - **Analysis Period**: Last 30 days - **Available Data**: - - `/tmp/gh-aw/pr-data/copilot-prs.json` - Summary PR data for copilot-created PRs - - `/tmp/gh-aw/prompt-cache/pr-full-data/` - Full PR data with comments, reviews, commits, and files for each PR - - `/tmp/gh-aw/prompt-cache/pr-full-data/index.txt` - List of all PR numbers with full data - - `/tmp/gh-aw/prompt-cache/` - Cache directory for avoiding repeated work + - `/tmp/gh-aw/agent/pr-data/copilot-prs.json` - Summary PR data for copilot-created PRs + - `/tmp/gh-aw/agent/prompt-cache/pr-full-data/` - Full PR data with comments, reviews, commits, and files for each PR + - `/tmp/gh-aw/agent/prompt-cache/pr-full-data/index.txt` - List of all PR numbers with full data + - `/tmp/gh-aw/agent/prompt-cache/` - Cache directory for avoiding repeated work ## Task Overview ### Phase 1: Extract Task Prompts from PRs The pre-fetched PR data is available at: -- `/tmp/gh-aw/pr-data/copilot-prs.json` - Summary data from search -- `/tmp/gh-aw/prompt-cache/pr-full-data/` - Full PR data for each PR with comments, reviews, commits, and files +- `/tmp/gh-aw/agent/pr-data/copilot-prs.json` - Summary data from search +- `/tmp/gh-aw/agent/prompt-cache/pr-full-data/` - Full PR data for each PR with comments, reviews, commits, and files Each PR's full data includes: @@ -145,13 +145,13 @@ Each PR's full data includes: ```bash # List all PRs with full data -cat /tmp/gh-aw/prompt-cache/pr-full-data/index.txt +cat /tmp/gh-aw/agent/prompt-cache/pr-full-data/index.txt # Read a specific PR's full data -cat /tmp/gh-aw/prompt-cache/pr-full-data/pr-123.json +cat /tmp/gh-aw/agent/prompt-cache/pr-full-data/pr-123.json # Extract relevant fields from all PRs -for pr_file in /tmp/gh-aw/prompt-cache/pr-full-data/pr-*.json; do +for pr_file in /tmp/gh-aw/agent/prompt-cache/pr-full-data/pr-*.json; do jq -r '{ number: .number, title: .title, @@ -168,7 +168,7 @@ for pr_file in /tmp/gh-aw/prompt-cache/pr-full-data/pr-*.json; do additions: .additions, deletions: .deletions }' "$pr_file" -done > /tmp/gh-aw/pr-data/pr-prompts.jsonl +done > /tmp/gh-aw/agent/pr-data/pr-prompts.jsonl ``` The PR body typically contains: @@ -194,14 +194,14 @@ Use the `gh-aw` MCP server to: ```bash # Download logs for recent copilot workflows # This creates directories with aw_info.json containing turn counts -gh-aw logs --engine copilot --start-date -30d -o /tmp/gh-aw/workflow-logs +gh-aw logs --engine copilot --start-date -30d -o /tmp/gh-aw/agent/workflow-logs ``` Then extract turn counts from `aw_info.json` files: ```bash # Find all aw_info.json files and extract turn information -find /tmp/gh-aw/workflow-logs -name "aw_info.json" -exec jq '{ +find /tmp/gh-aw/agent/workflow-logs -name "aw_info.json" -exec jq '{ run_id: .run_id, workflow: .workflow_name, engine: .engine, @@ -209,7 +209,7 @@ find /tmp/gh-aw/workflow-logs -name "aw_info.json" -exec jq '{ actual_turns: .turns, duration: .duration, cost: .cost -}' {} \; > /tmp/gh-aw/pr-data/workflow-metrics.jsonl +}' {} \; > /tmp/gh-aw/agent/pr-data/workflow-metrics.jsonl ``` **Match PRs to workflow runs** by: @@ -229,7 +229,7 @@ Create a structured dataset combining: ```bash # Merge full PR data with workflow metrics -for pr_file in /tmp/gh-aw/prompt-cache/pr-full-data/pr-*.json; do +for pr_file in /tmp/gh-aw/agent/prompt-cache/pr-full-data/pr-*.json; do jq -r '{ number: .number, title: .title, @@ -247,17 +247,17 @@ for pr_file in /tmp/gh-aw/prompt-cache/pr-full-data/pr-*.json; do deletions: .deletions, review_decision: .reviewDecision }' "$pr_file" -done > /tmp/gh-aw/pr-data/pr-prompts-full.jsonl +done > /tmp/gh-aw/agent/pr-data/pr-prompts-full.jsonl # Combine into a single JSON array -jq -s '.' /tmp/gh-aw/pr-data/pr-prompts-full.jsonl > /tmp/gh-aw/pr-data/combined-data.json +jq -s '.' /tmp/gh-aw/agent/pr-data/pr-prompts-full.jsonl > /tmp/gh-aw/agent/pr-data/combined-data.json ``` ### Phase 4: Python NLP Clustering Analysis Create a Python script to perform clustering analysis on the prompts: -**Script**: `/tmp/gh-aw/analyze-prompts.py` +**Script**: `/tmp/gh-aw/agent/analyze-prompts.py` ```python #!/usr/bin/env python3 @@ -273,7 +273,7 @@ from collections import Counter import re # Load data -with open('/tmp/gh-aw/pr-data/combined-data.json') as f: +with open('/tmp/gh-aw/agent/pr-data/combined-data.json') as f: data = json.load(f) # Extract prompts and metadata @@ -439,7 +439,7 @@ def generate_report(cluster_analysis, vectorizer, model): report.append(f"- **Example PRs**: {', '.join(f'#{pr}' for pr in info['example_prs'])}\n") # Save report - with open('/tmp/gh-aw/pr-data/clustering-report.md', 'w') as f: + with open('/tmp/gh-aw/agent/pr-data/clustering-report.md', 'w') as f: f.write('\n'.join(report)) print('\n'.join(report)) @@ -450,8 +450,8 @@ def generate_report(cluster_analysis, vectorizer, model): **Run the analysis**: ```bash -cd /tmp/gh-aw -python3 analyze-prompts.py > /tmp/gh-aw/pr-data/analysis-output.txt +cd /tmp/gh-aw/agent +python3 analyze-prompts.py > /tmp/gh-aw/agent/pr-data/analysis-output.txt ``` ### Phase 5: Generate Daily Discussion Report @@ -559,17 +559,17 @@ _Generated by Prompt Clustering Analysis (Run: [run_id])_ Use the cache to avoid re-analyzing the same PRs: **Cache Strategy**: -1. Store processed prompts in `/tmp/gh-aw/prompt-cache/processed-prs.json` +1. Store processed prompts in `/tmp/gh-aw/agent/prompt-cache/processed-prs.json` 2. Include PR number and last analyzed date 3. On next run, skip PRs that haven't changed 4. Update cache after each analysis ```bash # Save processed PR list to cache -jq -r '.[].number' /tmp/gh-aw/pr-data/copilot-prs.json | sort > /tmp/gh-aw/prompt-cache/analyzed-prs.txt +jq -r '.[].number' /tmp/gh-aw/agent/pr-data/copilot-prs.json | sort > /tmp/gh-aw/agent/prompt-cache/analyzed-prs.txt # On next run, compare and only process new PRs -comm -13 /tmp/gh-aw/prompt-cache/analyzed-prs.txt <(new-prs) > /tmp/gh-aw/pr-data/new-prs.txt +comm -13 /tmp/gh-aw/agent/prompt-cache/analyzed-prs.txt <(new-prs) > /tmp/gh-aw/agent/pr-data/new-prs.txt ``` ## Important Guidelines diff --git a/.github/workflows/release.md b/.github/workflows/release.md index 4621c949e39..aa167114d2f 100644 --- a/.github/workflows/release.md +++ b/.github/workflows/release.md @@ -412,10 +412,10 @@ steps: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | set -e - mkdir -p /tmp/gh-aw/release-data - mkdir -p /tmp/gh-aw/community-data + mkdir -p /tmp/gh-aw/agent/release-data + mkdir -p /tmp/gh-aw/agent/community-data # Copy community issues from the agent/community-data path (written by community-attribution import step) - cp /tmp/gh-aw/agent/community-data/community_issues.json /tmp/gh-aw/community-data/community_issues.json 2>/dev/null || echo "[]" > /tmp/gh-aw/community-data/community_issues.json + cp /tmp/gh-aw/agent/community-data/community_issues.json /tmp/gh-aw/agent/community-data/community_issues.json 2>/dev/null || echo "[]" > /tmp/gh-aw/agent/community-data/community_issues.json # Use the release ID and tag from the release job echo "Release ID from release job: $RELEASE_ID" @@ -426,7 +426,7 @@ steps: # Get the current release information # Use release ID to fetch release data - gh api "/repos/$GITHUB_REPOSITORY/releases/$RELEASE_ID" > /tmp/gh-aw/release-data/current_release.json + gh api "/repos/$GITHUB_REPOSITORY/releases/$RELEASE_ID" > /tmp/gh-aw/agent/release-data/current_release.json echo "✓ Fetched current release information" # Get the previous release to determine the range @@ -435,8 +435,8 @@ steps: if [ -z "$PREV_RELEASE_TAG" ]; then echo "No previous release found. This appears to be the first release." echo "PREV_RELEASE_TAG=" >> "$GITHUB_ENV" - touch /tmp/gh-aw/release-data/pull_requests.json - echo "[]" > /tmp/gh-aw/release-data/pull_requests.json + touch /tmp/gh-aw/agent/release-data/pull_requests.json + echo "[]" > /tmp/gh-aw/agent/release-data/pull_requests.json else echo "Previous release: $PREV_RELEASE_TAG" echo "PREV_RELEASE_TAG=$PREV_RELEASE_TAG" >> "$GITHUB_ENV" @@ -454,9 +454,9 @@ steps: --limit 1000 \ --json number,title,author,labels,mergedAt,url,body,closingIssuesReferences \ --jq "[.[] | select(.mergedAt >= \"$PREV_PUBLISHED_AT\" and .mergedAt <= \"$CURR_PUBLISHED_AT\")]" \ - > /tmp/gh-aw/release-data/pull_requests.json + > /tmp/gh-aw/agent/release-data/pull_requests.json - PR_COUNT=$(jq length "/tmp/gh-aw/release-data/pull_requests.json") + PR_COUNT=$(jq length "/tmp/gh-aw/agent/release-data/pull_requests.json") echo "✓ Fetched $PR_COUNT pull requests" fi @@ -474,44 +474,44 @@ steps: .[$key] = (.[$key] // []) + [$pr.number] ) ) - ' /tmp/gh-aw/release-data/pull_requests.json \ - > /tmp/gh-aw/release-data/closing_refs_by_issue.json 2>/dev/null \ - || echo "{}" > /tmp/gh-aw/release-data/closing_refs_by_issue.json + ' /tmp/gh-aw/agent/release-data/pull_requests.json \ + > /tmp/gh-aw/agent/release-data/closing_refs_by_issue.json 2>/dev/null \ + || echo "{}" > /tmp/gh-aw/agent/release-data/closing_refs_by_issue.json # Also expose to community-data dir so shared attribution strategy can reference it - cp /tmp/gh-aw/release-data/closing_refs_by_issue.json /tmp/gh-aw/community-data/closing_refs_by_issue.json - cp /tmp/gh-aw/release-data/pull_requests.json /tmp/gh-aw/community-data/pull_requests.json + cp /tmp/gh-aw/agent/release-data/closing_refs_by_issue.json /tmp/gh-aw/agent/community-data/closing_refs_by_issue.json + cp /tmp/gh-aw/agent/release-data/pull_requests.json /tmp/gh-aw/agent/community-data/pull_requests.json - DIRECT_CLOSE_COUNT=$(jq 'keys | length' /tmp/gh-aw/release-data/closing_refs_by_issue.json) + DIRECT_CLOSE_COUNT=$(jq 'keys | length' /tmp/gh-aw/agent/release-data/closing_refs_by_issue.json) echo "✓ Found $DIRECT_CLOSE_COUNT issues with GitHub-native closing PR references" # Find community issues closed during this release window (candidates for attribution review) if [ -n "$PREV_PUBLISHED_AT" ]; then jq --arg prev "$PREV_PUBLISHED_AT" --arg curr "$CURR_PUBLISHED_AT" \ '[.[] | select(.closedAt != null and .closedAt >= $prev and .closedAt <= $curr)]' \ - /tmp/gh-aw/community-data/community_issues.json \ - > /tmp/gh-aw/release-data/community_issues_closed_in_window.json 2>/dev/null \ - || echo "[]" > /tmp/gh-aw/release-data/community_issues_closed_in_window.json + /tmp/gh-aw/agent/community-data/community_issues.json \ + > /tmp/gh-aw/agent/release-data/community_issues_closed_in_window.json 2>/dev/null \ + || echo "[]" > /tmp/gh-aw/agent/release-data/community_issues_closed_in_window.json - CLOSED_IN_WINDOW=$(jq length /tmp/gh-aw/release-data/community_issues_closed_in_window.json) + CLOSED_IN_WINDOW=$(jq length /tmp/gh-aw/agent/release-data/community_issues_closed_in_window.json) echo "✓ Found $CLOSED_IN_WINDOW community issues closed in this release window" else - echo "[]" > /tmp/gh-aw/release-data/community_issues_closed_in_window.json + echo "[]" > /tmp/gh-aw/agent/release-data/community_issues_closed_in_window.json fi # Get the CHANGELOG.md content around this version if [ -f "CHANGELOG.md" ]; then - cp CHANGELOG.md /tmp/gh-aw/release-data/CHANGELOG.md + cp CHANGELOG.md /tmp/gh-aw/agent/release-data/CHANGELOG.md echo "✓ Copied CHANGELOG.md for reference" fi # List documentation files for linking - find docs -type f -name "*.md" 2>/dev/null > /tmp/gh-aw/release-data/docs_files.txt || echo "No docs directory found" + find docs -type f -name "*.md" 2>/dev/null > /tmp/gh-aw/agent/release-data/docs_files.txt || echo "No docs directory found" echo "✓ Setup complete." - echo " Release data: /tmp/gh-aw/release-data/ (current_release.json, pull_requests.json," + echo " Release data: /tmp/gh-aw/agent/release-data/ (current_release.json, pull_requests.json," echo " closing_refs_by_issue.json, community_issues_closed_in_window.json," echo " CHANGELOG.md (if exists), docs_files.txt)" - echo " Community data: /tmp/gh-aw/community-data/ (community_issues.json," + echo " Community data: /tmp/gh-aw/agent/community-data/ (community_issues.json," echo " closing_refs_by_issue.json, pull_requests.json)" tools: @@ -532,7 +532,7 @@ Generate an engaging release highlights summary for **$GITHUB_REPOSITORY** relea ## Data Available -Release-specific data is pre-fetched in `/tmp/gh-aw/release-data/`: +Release-specific data is pre-fetched in `/tmp/gh-aw/agent/release-data/`: - `current_release.json` - Release metadata (tag, name, dates, existing body) - `pull_requests.json` - PRs merged between `${PREV_RELEASE_TAG}` and `${RELEASE_TAG}` (includes `closingIssuesReferences` for each PR; empty array if first release) - `closing_refs_by_issue.json` - Map of `{issue_number: [pr_numbers]}` built from GitHub-native closing references in merged PRs @@ -540,7 +540,7 @@ Release-specific data is pre-fetched in `/tmp/gh-aw/release-data/`: - `CHANGELOG.md` - Full changelog for context (if exists) - `docs_files.txt` - Available documentation files for linking -Community data is pre-fetched in `/tmp/gh-aw/community-data/` (by the shared community-attribution step): +Community data is pre-fetched in `/tmp/gh-aw/agent/community-data/` (by the shared community-attribution step): - `community_issues.json` - All issues labeled `community` (issue number, title, author, closedAt, createdAt, url) - `closing_refs_by_issue.json` - Same closing references index, mirrored for the shared attribution strategy - `pull_requests.json` - Same PR list, mirrored for the shared attribution strategy @@ -560,25 +560,25 @@ Create a **"🌟 Release Highlights"** section that: ```bash # View release metadata -cat /tmp/gh-aw/release-data/current_release.json | jq +cat /tmp/gh-aw/agent/release-data/current_release.json | jq # List PRs (empty if first release) -cat /tmp/gh-aw/release-data/pull_requests.json | jq -r '.[] | "- #\(.number): \(.title) by @\(.author.login)"' +cat /tmp/gh-aw/agent/release-data/pull_requests.json | jq -r '.[] | "- #\(.number): \(.title) by @\(.author.login)"' # List community issues (fetched by shared community-attribution step) -cat /tmp/gh-aw/community-data/community_issues.json | jq -r '.[] | "- #\(.number): \(.title) by @\(.author.login)"' +cat /tmp/gh-aw/agent/community-data/community_issues.json | jq -r '.[] | "- #\(.number): \(.title) by @\(.author.login)"' # View GitHub-native closing references (issue -> [PRs]) -cat /tmp/gh-aw/release-data/closing_refs_by_issue.json | jq +cat /tmp/gh-aw/agent/release-data/closing_refs_by_issue.json | jq # List community issues closed in this release window (attribution candidates) -cat /tmp/gh-aw/release-data/community_issues_closed_in_window.json | jq -r '.[] | "- #\(.number): \(.title) by @\(.author.login) (closed: \(.closedAt))"' +cat /tmp/gh-aw/agent/release-data/community_issues_closed_in_window.json | jq -r '.[] | "- #\(.number): \(.title) by @\(.author.login) (closed: \(.closedAt))"' # Check CHANGELOG context -head -100 /tmp/gh-aw/release-data/CHANGELOG.md 2>/dev/null || echo "No CHANGELOG" +head -100 /tmp/gh-aw/agent/release-data/CHANGELOG.md 2>/dev/null || echo "No CHANGELOG" # View available docs -cat /tmp/gh-aw/release-data/docs_files.txt +cat /tmp/gh-aw/agent/release-data/docs_files.txt ``` ### 2. Identify Community Contributions @@ -586,8 +586,8 @@ cat /tmp/gh-aw/release-data/docs_files.txt The `community` label is the **primary attribution signal** — apply the four-tier Community Attribution Strategy from the imported shared component (`shared/community-attribution.md`) to attribute all community-labeled issues -that were closed in this release window. Use `/tmp/gh-aw/release-data/community_issues_closed_in_window.json` -as the set of candidates and `/tmp/gh-aw/release-data/closing_refs_by_issue.json` +that were closed in this release window. Use `/tmp/gh-aw/agent/release-data/community_issues_closed_in_window.json` +as the set of candidates and `/tmp/gh-aw/agent/release-data/closing_refs_by_issue.json` as the attribution index. ### 3. Categorize & Prioritize @@ -681,7 +681,7 @@ safeoutputs/update_release( ``` **❌ INCORRECT - DO NOT:** -- Write JSON files manually (e.g., `/tmp/gh-aw/safeoutputs/update_release_001.json`) +- Write JSON files manually (e.g., `/tmp/gh-aw/agent/safeoutputs/update_release_001.json`) - Use bash to simulate tool calls - Create scripts that write to outputs.jsonl - Use any file operations - the MCP tool handles everything diff --git a/.github/workflows/repo-audit-analyzer.md b/.github/workflows/repo-audit-analyzer.md index 2975bec1f13..859ec615808 100644 --- a/.github/workflows/repo-audit-analyzer.md +++ b/.github/workflows/repo-audit-analyzer.md @@ -108,7 +108,7 @@ Analyze the repository structure to understand the project: ```bash # Clone repository for deep analysis -REPO_DIR="/tmp/repo-analysis" +REPO_DIR="/tmp/gh-aw/agent/repo-analysis" git clone "https://github.com/${{ inputs.repository }}.git" "$REPO_DIR" --depth 1 cd "$REPO_DIR" @@ -231,10 +231,10 @@ gh api "repos/${{ inputs.repository }}/actions/runs?per_page=100&created=>=$(dat conclusion: .conclusion, created_at: .created_at, run_number: .run_number -}' > /tmp/workflow_runs.json +}' > /tmp/gh-aw/agent/workflow_runs.json # Success rate -cat /tmp/workflow_runs.json | jq -s 'group_by(.name) | map({ +cat /tmp/gh-aw/agent/workflow_runs.json | jq -s 'group_by(.name) | map({ workflow: .[0].name, total: length, success: map(select(.conclusion == "success")) | length, @@ -243,7 +243,7 @@ cat /tmp/workflow_runs.json | jq -s 'group_by(.name) | map({ })' # Failed runs analysis -cat /tmp/workflow_runs.json | jq -s 'map(select(.conclusion == "failure")) | group_by(.name) | map({ +cat /tmp/gh-aw/agent/workflow_runs.json | jq -s 'map(select(.conclusion == "failure")) | group_by(.name) | map({ workflow: .[0].name, failures: length }) | sort_by(.failures) | reverse' @@ -292,19 +292,19 @@ gh api "repos/${{ inputs.repository }}/issues?state=all&per_page=100&since=$(dat created_at: .created_at, closed_at: .closed_at, comments: .comments -}' > /tmp/issues.json +}' > /tmp/gh-aw/agent/issues.json # Issue categories (by labels) -cat /tmp/issues.json | jq -s 'map(.labels[]) | group_by(.) | map({label: .[0], count: length}) | sort_by(.count) | reverse' +cat /tmp/gh-aw/agent/issues.json | jq -s 'map(.labels[]) | group_by(.) | map({label: .[0], count: length}) | sort_by(.count) | reverse' # Open vs closed ratio -cat /tmp/issues.json | jq -s 'group_by(.state) | map({state: .[0].state, count: length})' +cat /tmp/gh-aw/agent/issues.json | jq -s 'group_by(.state) | map({state: .[0].state, count: length})' # Issues with most comments (high engagement) -cat /tmp/issues.json | jq -s 'sort_by(.comments) | reverse | .[0:10] | .[] | {number: .number, title: .title, comments: .comments}' +cat /tmp/gh-aw/agent/issues.json | jq -s 'sort_by(.comments) | reverse | .[0:10] | .[] | {number: .number, title: .title, comments: .comments}' # Common words in issue titles (identify patterns) -cat /tmp/issues.json | jq -r '.[].title' | tr '[:upper:]' '[:lower:]' | tr ' ' '\n' | sort | uniq -c | sort -rn | head -30 +cat /tmp/gh-aw/agent/issues.json | jq -r '.[].title' | tr '[:upper:]' '[:lower:]' | tr ' ' '\n' | sort | uniq -c | sort -rn | head -30 ``` ### 3.2 Identify Automation Opportunities in Issues @@ -313,16 +313,16 @@ Look for issues that could be automated: ```bash # Issues about CI/CD -cat /tmp/issues.json | jq -s 'map(select(.title | test("ci|cd|build|test|deploy"; "i"))) | length' +cat /tmp/gh-aw/agent/issues.json | jq -s 'map(select(.title | test("ci|cd|build|test|deploy"; "i"))) | length' # Issues about documentation -cat /tmp/issues.json | jq -s 'map(select(.title | test("doc|documentation|readme"; "i"))) | length' +cat /tmp/gh-aw/agent/issues.json | jq -s 'map(select(.title | test("doc|documentation|readme"; "i"))) | length' # Issues about dependencies/updates -cat /tmp/issues.json | jq -s 'map(select(.title | test("update|upgrade|dependency|dependabot"; "i"))) | length' +cat /tmp/gh-aw/agent/issues.json | jq -s 'map(select(.title | test("update|upgrade|dependency|dependabot"; "i"))) | length' # Repetitive issues (same labels appearing frequently) -cat /tmp/issues.json | jq -s 'map(select(.labels | length > 0)) | group_by(.labels | sort) | map({labels: .[0].labels, count: length}) | sort_by(.count) | reverse | .[0:10]' +cat /tmp/gh-aw/agent/issues.json | jq -s 'map(select(.labels | length > 0)) | group_by(.labels | sort) | map({labels: .[0].labels, count: length}) | sort_by(.count) | reverse | .[0:10]' ``` ## Phase 4: Identify Agentic Workflow Opportunities diff --git a/.github/workflows/shared/ci-data-analysis.md b/.github/workflows/shared/ci-data-analysis.md index 4f71453bfc4..5bb13a95356 100644 --- a/.github/workflows/shared/ci-data-analysis.md +++ b/.github/workflows/shared/ci-data-analysis.md @@ -24,13 +24,13 @@ steps: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | # Download workflow runs for split CI workflows (ci, cgo, cjs) - gh run list --repo "$GITHUB_REPOSITORY" --workflow=ci.yml --limit 30 --json databaseId,status,conclusion,createdAt,updatedAt,displayTitle,headBranch,event,url,workflowDatabaseId,number > /tmp/ci-runs-ci.json - gh run list --repo "$GITHUB_REPOSITORY" --workflow=cgo.yml --limit 30 --json databaseId,status,conclusion,createdAt,updatedAt,displayTitle,headBranch,event,url,workflowDatabaseId,number > /tmp/ci-runs-cgo.json - gh run list --repo "$GITHUB_REPOSITORY" --workflow=cjs.yml --limit 30 --json databaseId,status,conclusion,createdAt,updatedAt,displayTitle,headBranch,event,url,workflowDatabaseId,number > /tmp/ci-runs-cjs.json - jq -s 'add | sort_by(.createdAt) | reverse | .[0:60]' /tmp/ci-runs-ci.json /tmp/ci-runs-cgo.json /tmp/ci-runs-cjs.json > /tmp/ci-runs.json + gh run list --repo "$GITHUB_REPOSITORY" --workflow=ci.yml --limit 30 --json databaseId,status,conclusion,createdAt,updatedAt,displayTitle,headBranch,event,url,workflowDatabaseId,number > /tmp/gh-aw/agent/ci-runs-ci.json + gh run list --repo "$GITHUB_REPOSITORY" --workflow=cgo.yml --limit 30 --json databaseId,status,conclusion,createdAt,updatedAt,displayTitle,headBranch,event,url,workflowDatabaseId,number > /tmp/gh-aw/agent/ci-runs-cgo.json + gh run list --repo "$GITHUB_REPOSITORY" --workflow=cjs.yml --limit 30 --json databaseId,status,conclusion,createdAt,updatedAt,displayTitle,headBranch,event,url,workflowDatabaseId,number > /tmp/gh-aw/agent/ci-runs-cjs.json + jq -s 'add | sort_by(.createdAt) | reverse | .[0:60]' /tmp/gh-aw/agent/ci-runs-ci.json /tmp/gh-aw/agent/ci-runs-cgo.json /tmp/gh-aw/agent/ci-runs-cjs.json > /tmp/gh-aw/agent/ci-runs.json # Create directory for artifacts - mkdir -p /tmp/ci-artifacts + mkdir -p /tmp/gh-aw/agent/ci-artifacts # Download artifacts from recent successful runs across split workflows echo "Downloading artifacts from recent CI/cgo/cjs runs..." @@ -40,11 +40,11 @@ steps: gh run list --repo "$GITHUB_REPOSITORY" --workflow=cjs.yml --status success --limit 2 --json databaseId } | jq -s 'add | .[].databaseId' -r | while read -r run_id; do echo "Processing run $run_id" - gh run download "$run_id" --repo "$GITHUB_REPOSITORY" --dir "/tmp/ci-artifacts/$run_id" 2>/dev/null || echo "No artifacts for run $run_id" + gh run download "$run_id" --repo "$GITHUB_REPOSITORY" --dir "/tmp/gh-aw/agent/ci-artifacts/$run_id" 2>/dev/null || echo "No artifacts for run $run_id" done - echo "CI runs data saved to /tmp/ci-runs.json" - echo "Artifacts saved to /tmp/ci-artifacts/" + echo "CI runs data saved to /tmp/gh-aw/agent/ci-runs.json" + echo "Artifacts saved to /tmp/gh-aw/agent/ci-artifacts/" - name: Build CI summary for optimization analysis run: | @@ -61,10 +61,10 @@ steps: branch_counts: (group_by(.headBranch) | map({branch: .[0].headBranch, count: length}) | sort_by(-.count) | .[0:10]), avg_duration_seconds: ([.[] | safe_duration | select(. != null)] | if length > 0 then (add / length) else null end), top_recent_failures: ([.[] | select(.conclusion == "failure" or .conclusion == "cancelled") | {id: .databaseId, run_number: .number, title: .displayTitle, branch: .headBranch, event: .event, url: .url, updated_at: .updatedAt}] | sort_by(.updated_at) | reverse | .[0:10]) - }' /tmp/ci-runs.json > /tmp/ci-summary.json + }' /tmp/gh-aw/agent/ci-runs.json > /tmp/gh-aw/agent/ci-summary.json echo "## CI Summary" >> "$GITHUB_STEP_SUMMARY" - jq -r '"- runs analyzed: \(.total_runs)\n- avg duration (sec): \(.avg_duration_seconds // "n/a")\n- recent failure records: \(.top_recent_failures | length)"' /tmp/ci-summary.json >> "$GITHUB_STEP_SUMMARY" + jq -r '"- runs analyzed: \(.total_runs)\n- avg duration (sec): \(.avg_duration_seconds // "n/a")\n- recent failure records: \(.top_recent_failures | length)"' /tmp/gh-aw/agent/ci-summary.json >> "$GITHUB_STEP_SUMMARY" - name: Setup Node.js uses: actions/setup-node@v6.4.0 @@ -103,8 +103,8 @@ steps: - name: Run unit tests continue-on-error: true run: | - mkdir -p /tmp/gh-aw - go test -v -json -count=1 -timeout=3m -tags '!integration' -run='^Test' ./... | tee /tmp/gh-aw/test-results.json + mkdir -p /tmp/gh-aw/agent + go test -v -json -count=1 -timeout=3m -tags '!integration' -run='^Test' ./... | tee /tmp/gh-aw/agent/test-results.json --- # CI Data Analysis @@ -113,13 +113,13 @@ Pre-downloaded CI run data and artifacts are available for analysis: ## Available Data -1. **CI Runs**: `/tmp/ci-runs.json` +1. **CI Runs**: `/tmp/gh-aw/agent/ci-runs.json` - Last 60 workflow runs with status, timing, and metadata from `ci.yml`, `cgo.yml`, and `cjs.yml` -2. **CI Summary**: `/tmp/ci-summary.json` +2. **CI Summary**: `/tmp/gh-aw/agent/ci-summary.json` - Pre-computed totals, failure patterns, branch distribution, and average duration -3. **Artifacts**: `/tmp/ci-artifacts/` +3. **Artifacts**: `/tmp/gh-aw/agent/ci-artifacts/` - Coverage reports and benchmark results from recent successful runs - **Fuzz test results**: `*/fuzz-results/*.txt` - Output from fuzz tests - **Fuzz corpus data**: `*/fuzz-results/corpus/*` - Input corpus for each fuzz test @@ -132,7 +132,7 @@ Pre-downloaded CI run data and artifacts are available for analysis: 5. **Cache Memory**: `/tmp/gh-aw/cache-memory/` - Historical analysis data from previous runs -6. **Test Results**: `/tmp/gh-aw/test-results.json` +6. **Test Results**: `/tmp/gh-aw/agent/test-results.json` - JSON output from Go unit tests with performance and timing data ## Test Case Locations @@ -162,14 +162,14 @@ This means you can: Start with the pre-computed summary: ```bash -cat /tmp/ci-summary.json | jq . +cat /tmp/gh-aw/agent/ci-summary.json | jq . ``` Only use raw run data for deeper validation: ```bash # Analyze run data -cat /tmp/ci-runs.json | jq ' +cat /tmp/gh-aw/agent/ci-runs.json | jq ' { total_runs: length, by_status: group_by(.status) | map({status: .[0].status, count: length}), @@ -192,7 +192,7 @@ Examine downloaded artifacts for insights: ```bash # List downloaded artifacts -find /tmp/ci-artifacts -type f -name "*.txt" -o -name "*.html" -o -name "*.json" +find /tmp/gh-aw/agent/ci-artifacts -type f -name "*.txt" -o -name "*.html" -o -name "*.json" # Analyze coverage reports if available # Check benchmark results for performance trends diff --git a/.github/workflows/shared/ci-optimization-strategies.md b/.github/workflows/shared/ci-optimization-strategies.md index 8f4449bcb26..6fdcb12aed2 100644 --- a/.github/workflows/shared/ci-optimization-strategies.md +++ b/.github/workflows/shared/ci-optimization-strategies.md @@ -48,18 +48,18 @@ cat .github/workflows/cjs.yml **Step 1: Get complete list of all tests** ```bash -go test -list='^Test' ./... 2>&1 | grep -E '^Test' > /tmp/all-tests.txt +go test -list='^Test' ./... 2>&1 | grep -E '^Test' > /tmp/gh-aw/agent/all-tests.txt ``` **Step 2: Analyze unit/integration split** ```bash -grep -r "//go:build integration" --include="*_test.go" . | cut -d: -f1 | sort -u > /tmp/integration-test-files.txt +grep -r "//go:build integration" --include="*_test.go" . | cut -d: -f1 | sort -u > /tmp/gh-aw/agent/integration-test-files.txt ``` **Step 3: Analyze integration matrix coverage** ```bash -cat .github/workflows/ci.yml | grep -A 2 'pattern:' | grep 'pattern:' > /tmp/matrix-patterns.txt -cat .github/workflows/ci.yml | grep -B 2 'pattern: ""' | grep 'name:' > /tmp/catchall-groups.txt +cat .github/workflows/ci.yml | grep -A 2 'pattern:' | grep 'pattern:' > /tmp/gh-aw/agent/matrix-patterns.txt +cat .github/workflows/ci.yml | grep -B 2 'pattern: ""' | grep 'name:' > /tmp/gh-aw/agent/catchall-groups.txt ``` **Step 4: Identify coverage gaps** diff --git a/.github/workflows/shared/copilot-pr-analysis-base.md b/.github/workflows/shared/copilot-pr-analysis-base.md index cb36ea7fac2..b5030e961fb 100644 --- a/.github/workflows/shared/copilot-pr-analysis-base.md +++ b/.github/workflows/shared/copilot-pr-analysis-base.md @@ -13,7 +13,7 @@ imports: ## Copilot PR Analysis Base -Pre-fetched Copilot PR data is available at `/tmp/gh-aw/pr-data/copilot-prs.json` (last 30 days, up to 1000 PRs from `copilot/*` branches). +Pre-fetched Copilot PR data is available at `/tmp/gh-aw/agent/pr-data/copilot-prs.json` (last 30 days, up to 1000 PRs from `copilot/*` branches). ### Historical Data with repo-memory @@ -35,11 +35,11 @@ tools: ```bash # Count total PRs -jq 'length' /tmp/gh-aw/pr-data/copilot-prs.json +jq 'length' /tmp/gh-aw/agent/pr-data/copilot-prs.json # PRs from last 7 days -jq '[.[] | select(.createdAt >= "'"$(date -d '7 days ago' '+%Y-%m-%dT%H:%M:%SZ' 2>/dev/null || date -v-7d '+%Y-%m-%dT%H:%M:%SZ')"'")]' /tmp/gh-aw/pr-data/copilot-prs.json +jq '[.[] | select(.createdAt >= "'"$(date -d '7 days ago' '+%Y-%m-%dT%H:%M:%SZ' 2>/dev/null || date -v-7d '+%Y-%m-%dT%H:%M:%SZ')"'")]' /tmp/gh-aw/agent/pr-data/copilot-prs.json # Merged vs closed stats -jq 'group_by(.state) | map({state: .[0].state, count: length})' /tmp/gh-aw/pr-data/copilot-prs.json +jq 'group_by(.state) | map({state: .[0].state, count: length})' /tmp/gh-aw/agent/pr-data/copilot-prs.json ``` diff --git a/.github/workflows/shared/copilot-pr-data-fetch.md b/.github/workflows/shared/copilot-pr-data-fetch.md index 8a03298292d..1b7e2396345 100644 --- a/.github/workflows/shared/copilot-pr-data-fetch.md +++ b/.github/workflows/shared/copilot-pr-data-fetch.md @@ -4,7 +4,7 @@ tools: key: copilot-pr-data bash: - "jq *" - - "/tmp/gh-aw/jqschema.sh" + - "/tmp/gh-aw/agent/jqschema.sh" - "mkdir *" - "date *" - "cp *" @@ -21,7 +21,7 @@ steps: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | # Create output directories - mkdir -p /tmp/gh-aw/pr-data + mkdir -p /tmp/gh-aw/agent/pr-data mkdir -p /tmp/gh-aw/cache-memory # Get today's date for cache identification @@ -31,16 +31,16 @@ steps: # Check if cached data exists from today if [ -f "$CACHE_DIR/copilot-prs-${TODAY}.json" ] && [ -s "$CACHE_DIR/copilot-prs-${TODAY}.json" ]; then echo "✓ Found cached PR data from ${TODAY}" - cp "$CACHE_DIR/copilot-prs-${TODAY}.json" /tmp/gh-aw/pr-data/copilot-prs.json + cp "$CACHE_DIR/copilot-prs-${TODAY}.json" /tmp/gh-aw/agent/pr-data/copilot-prs.json # Regenerate schema if missing if [ ! -f "$CACHE_DIR/copilot-prs-${TODAY}-schema.json" ]; then - /tmp/gh-aw/jqschema.sh < /tmp/gh-aw/pr-data/copilot-prs.json > "$CACHE_DIR/copilot-prs-${TODAY}-schema.json" + /tmp/gh-aw/agent/jqschema.sh < /tmp/gh-aw/agent/pr-data/copilot-prs.json > "$CACHE_DIR/copilot-prs-${TODAY}-schema.json" fi - cp "$CACHE_DIR/copilot-prs-${TODAY}-schema.json" /tmp/gh-aw/pr-data/copilot-prs-schema.json + cp "$CACHE_DIR/copilot-prs-${TODAY}-schema.json" /tmp/gh-aw/agent/pr-data/copilot-prs-schema.json echo "Using cached data from ${TODAY}" - echo "Total PRs in cache: $(jq 'length' /tmp/gh-aw/pr-data/copilot-prs.json)" + echo "Total PRs in cache: $(jq 'length' /tmp/gh-aw/agent/pr-data/copilot-prs.json)" else echo "⬇ Downloading fresh PR data..." @@ -55,22 +55,22 @@ steps: --state all \ --json number,title,author,headRefName,createdAt,state,url,body,labels,updatedAt,closedAt,mergedAt \ --limit 1000 \ - > /tmp/gh-aw/pr-data/copilot-prs.json + > /tmp/gh-aw/agent/pr-data/copilot-prs.json # Generate schema for reference - /tmp/gh-aw/jqschema.sh < /tmp/gh-aw/pr-data/copilot-prs.json > /tmp/gh-aw/pr-data/copilot-prs-schema.json + /tmp/gh-aw/agent/jqschema.sh < /tmp/gh-aw/agent/pr-data/copilot-prs.json > /tmp/gh-aw/agent/pr-data/copilot-prs-schema.json # Store in cache with today's date - cp /tmp/gh-aw/pr-data/copilot-prs.json "$CACHE_DIR/copilot-prs-${TODAY}.json" - cp /tmp/gh-aw/pr-data/copilot-prs-schema.json "$CACHE_DIR/copilot-prs-${TODAY}-schema.json" + cp /tmp/gh-aw/agent/pr-data/copilot-prs.json "$CACHE_DIR/copilot-prs-${TODAY}.json" + cp /tmp/gh-aw/agent/pr-data/copilot-prs-schema.json "$CACHE_DIR/copilot-prs-${TODAY}-schema.json" echo "✓ PR data saved to cache: copilot-prs-${TODAY}.json" - echo "Total PRs found: $(jq 'length' /tmp/gh-aw/pr-data/copilot-prs.json)" + echo "Total PRs found: $(jq 'length' /tmp/gh-aw/agent/pr-data/copilot-prs.json)" fi # Always ensure data is available at expected locations for backward compatibility - echo "PR data available at: /tmp/gh-aw/pr-data/copilot-prs.json" - echo "Schema available at: /tmp/gh-aw/pr-data/copilot-prs-schema.json" + echo "PR data available at: /tmp/gh-aw/agent/pr-data/copilot-prs.json" + echo "Schema available at: /tmp/gh-aw/agent/pr-data/copilot-prs-schema.json" --- - diff --git a/.github/workflows/shared/weekly-issues-data-fetch.md b/.github/workflows/shared/weekly-issues-data-fetch.md index 639bb0fd2bf..4af11f466aa 100644 --- a/.github/workflows/shared/weekly-issues-data-fetch.md +++ b/.github/workflows/shared/weekly-issues-data-fetch.md @@ -6,7 +6,7 @@ tools: - "gh issue list *" - "gh api *" - "jq *" - - "/tmp/gh-aw/jqschema.sh" + - "/tmp/gh-aw/agent/jqschema.sh" - "mkdir *" - "date *" - "cp *" @@ -19,7 +19,7 @@ steps: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | # Create output directories - mkdir -p /tmp/gh-aw/weekly-issues-data + mkdir -p /tmp/gh-aw/agent/weekly-issues-data mkdir -p /tmp/gh-aw/cache-memory # Get today's date for cache identification @@ -29,16 +29,16 @@ steps: # Check if cached data exists from today if [ -f "$CACHE_DIR/weekly-issues-${TODAY}.json" ] && [ -s "$CACHE_DIR/weekly-issues-${TODAY}.json" ]; then echo "✓ Found cached weekly issues data from ${TODAY}" - cp "$CACHE_DIR/weekly-issues-${TODAY}.json" /tmp/gh-aw/weekly-issues-data/issues.json + cp "$CACHE_DIR/weekly-issues-${TODAY}.json" /tmp/gh-aw/agent/weekly-issues-data/issues.json # Regenerate schema if missing if [ ! -f "$CACHE_DIR/weekly-issues-${TODAY}-schema.json" ]; then - /tmp/gh-aw/jqschema.sh < /tmp/gh-aw/weekly-issues-data/issues.json > "$CACHE_DIR/weekly-issues-${TODAY}-schema.json" + /tmp/gh-aw/agent/jqschema.sh < /tmp/gh-aw/agent/weekly-issues-data/issues.json > "$CACHE_DIR/weekly-issues-${TODAY}-schema.json" fi - cp "$CACHE_DIR/weekly-issues-${TODAY}-schema.json" /tmp/gh-aw/weekly-issues-data/issues-schema.json + cp "$CACHE_DIR/weekly-issues-${TODAY}-schema.json" /tmp/gh-aw/agent/weekly-issues-data/issues-schema.json echo "Using cached data from ${TODAY}" - echo "Total issues in cache: $(jq 'length' /tmp/gh-aw/weekly-issues-data/issues.json)" + echo "Total issues in cache: $(jq 'length' /tmp/gh-aw/agent/weekly-issues-data/issues.json)" else echo "⬇ Downloading fresh weekly issues data..." @@ -54,22 +54,22 @@ steps: --state all \ --json number,title,author,createdAt,state,url,body,labels,updatedAt,closedAt,milestone,assignees,comments \ --limit 500 \ - > /tmp/gh-aw/weekly-issues-data/issues.json + > /tmp/gh-aw/agent/weekly-issues-data/issues.json # Generate schema for reference - /tmp/gh-aw/jqschema.sh < /tmp/gh-aw/weekly-issues-data/issues.json > /tmp/gh-aw/weekly-issues-data/issues-schema.json + /tmp/gh-aw/agent/jqschema.sh < /tmp/gh-aw/agent/weekly-issues-data/issues.json > /tmp/gh-aw/agent/weekly-issues-data/issues-schema.json # Store in cache with today's date - cp /tmp/gh-aw/weekly-issues-data/issues.json "$CACHE_DIR/weekly-issues-${TODAY}.json" - cp /tmp/gh-aw/weekly-issues-data/issues-schema.json "$CACHE_DIR/weekly-issues-${TODAY}-schema.json" + cp /tmp/gh-aw/agent/weekly-issues-data/issues.json "$CACHE_DIR/weekly-issues-${TODAY}.json" + cp /tmp/gh-aw/agent/weekly-issues-data/issues-schema.json "$CACHE_DIR/weekly-issues-${TODAY}-schema.json" echo "✓ Weekly issues data saved to cache: weekly-issues-${TODAY}.json" - echo "Total issues found: $(jq 'length' /tmp/gh-aw/weekly-issues-data/issues.json)" + echo "Total issues found: $(jq 'length' /tmp/gh-aw/agent/weekly-issues-data/issues.json)" fi # Always ensure data is available at expected locations for backward compatibility - echo "Weekly issues data available at: /tmp/gh-aw/weekly-issues-data/issues.json" - echo "Schema available at: /tmp/gh-aw/weekly-issues-data/issues-schema.json" + echo "Weekly issues data available at: /tmp/gh-aw/agent/weekly-issues-data/issues.json" + echo "Schema available at: /tmp/gh-aw/agent/weekly-issues-data/issues-schema.json" ---