Skip to content

Commit 157be4b

Browse files
authored
Merge branch 'main' into copilot/cleanup-html-files
2 parents f7cd612 + 7e25a53 commit 157be4b

26 files changed

Lines changed: 874 additions & 642 deletions

.github/aw/SHARED_PROMPT_PATTERNS.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,15 @@ TOTAL_READ_BYTES=0
7171
TOTAL_ONDISK_BYTES=0
7272
while read -r f; do
7373
if [ -f "$f" ]; then
74-
FSIZE=$(wc -c < "$f" | tr -d ' ')
74+
# AWF-safe: no $(...) command substitution — use tempfile + read redirection, then clean up.
75+
wc -c < "$f" | tr -d ' ' > /tmp/fsize-$$.txt
76+
read FSIZE < /tmp/fsize-$$.txt
77+
rm -f /tmp/fsize-$$.txt
7578
TOTAL_ONDISK_BYTES=$((TOTAL_ONDISK_BYTES + FSIZE))
76-
echo "--- BEGIN ANALYSIS FILE: $f (size: ${FSIZE} bytes) ---"
79+
echo "--- BEGIN ANALYSIS FILE: $f (size: $FSIZE bytes) ---"
7780
if [ "$FSIZE" -gt "$MAX_FILE_BYTES" ]; then
7881
# Extremely rare — emit the full file but warn.
79-
echo "⚠️ File exceeds ${MAX_FILE_BYTES}-byte soft cap; emitting in full regardless (§P0-5)."
82+
echo "⚠️ File exceeds $MAX_FILE_BYTES-byte soft cap; emitting in full regardless (§P0-5)."
8083
fi
8184
cat "$f"
8285
TOTAL_READ_BYTES=$((TOTAL_READ_BYTES + FSIZE))
@@ -497,7 +500,7 @@ if [ "$IS_TIER_C" = "1" ]; then
497500
monthly-review*) MULT_NUM=15; MULT_DEN=10 ;; # 1.5×
498501
*) MULT_NUM=10; MULT_DEN=10 ;; # fallback baseline
499502
esac
500-
echo "📐 Period-scope multiplier for '$ANALYSIS_SUBFOLDER': ${MULT_NUM}/${MULT_DEN}"
503+
echo "📐 Period-scope multiplier for '$ANALYSIS_SUBFOLDER': $MULT_NUM/$MULT_DEN"
501504

502505
declare -A TIER_C_BASE_SIZES=(
503506
["README.md"]=3000
@@ -513,9 +516,12 @@ if [ "$IS_TIER_C" = "1" ]; then
513516
echo "🔴 MISSING Tier-C: $REQUIRED_FILE — Tier-C workflow MUST CREATE"
514517
TIER_C_MISSING=$((TIER_C_MISSING + 1))
515518
else
516-
FSIZE=$(wc -c < "$ANALYSIS_DIR/$REQUIRED_FILE")
519+
# AWF-safe: no $(...) command substitution — use tempfile + read redirection, then clean up.
520+
wc -c < "$ANALYSIS_DIR/$REQUIRED_FILE" | tr -d ' ' > /tmp/fsize-$$.txt
521+
read FSIZE < /tmp/fsize-$$.txt
522+
rm -f /tmp/fsize-$$.txt
517523
if [ "$FSIZE" -lt "$MIN_SIZE" ]; then
518-
echo "🔴 UNDERSIZED Tier-C: $REQUIRED_FILE ($FSIZE bytes < $MIN_SIZE scaled minimum — base $BASE_SIZE × ${MULT_NUM}/${MULT_DEN}) — MUST ENRICH"
524+
echo "🔴 UNDERSIZED Tier-C: $REQUIRED_FILE ($FSIZE bytes < $MIN_SIZE scaled minimum — base $BASE_SIZE × $MULT_NUM/$MULT_DEN) — MUST ENRICH"
519525
TIER_C_MISSING=$((TIER_C_MISSING + 1))
520526
else
521527
echo "✅ OK Tier-C: $REQUIRED_FILE ($FSIZE bytes ≥ $MIN_SIZE scaled minimum)"
@@ -2663,9 +2669,10 @@ Then call the health gate:
26632669
> 🚨 **UNIVERSAL SAFE OUTPUT RULES — ALL WORKFLOWS MUST FOLLOW:**
26642670
>
26652671
> 1. **Call `safeoutputs___create_pull_request` as EARLY as possible** — the moment you have committed files. The safeoutputs MCP session has a finite lifetime. Successful runs call it by minute ~25. Failed runs that delayed past minute 40 got "session not found" and lost all work.
2666-
> 2. **NEVER call `safeoutputs___noop` when artifacts exist.** Noop means "I did nothing." If you created files, you DID something and MUST create a PR. Partial work in a PR is infinitely better than lost work via noop.
2667-
> 3. **At HARD DEADLINE**: If ANY files were created → `safeoutputs___create_pull_request`. ONLY noop if truly ZERO files were created.
2668-
> 4. **Architecture reminder**: `safeoutputs___create_pull_request` records your intent. A separate `safe_outputs` job executes the PR creation AFTER the agent job ends. If the MCP session expires before you record the intent, the `safe_outputs` job is SKIPPED and all work is lost.
2672+
> 2. **Heartbeat PR to keep the safeoutputs session alive (`max: 2+`)** — the Streamable-HTTP safeoutputs MCP session has a ~30–35 min idle lifetime (observed in PR #1835 and run #24672037751). Every `safeoutputs___create_pull_request` call **resets the session idle timer**. If the workflow sets `create-pull-request.max: 2` or higher, call the tool once at minute ~22–25 as a **heartbeat PR** capturing work-in-progress (partial analysis + first article draft), then call it again at minute 40–45 with the polished final output. Each call creates a separate PR on a separate branch; the final PR supersedes the heartbeat. This pattern was proven in `news-translate` (`max: 5`, zero session expiries across 55-minute runs) and `news-realtime-monitor` (`max: 3`). **Single-PR workflows (`max: 1`) that delay their only call past minute 35 WILL lose all work to session expiry.**
2673+
> 3. **NEVER call `safeoutputs___noop` when artifacts exist.** Noop means "I did nothing." If you created files, you DID something and MUST create a PR. Partial work in a PR is infinitely better than lost work via noop.
2674+
> 4. **At HARD DEADLINE**: If ANY files were created → `safeoutputs___create_pull_request`. ONLY noop if truly ZERO files were created.
2675+
> 5. **Architecture reminder**: `safeoutputs___create_pull_request` records your intent. A separate `safe_outputs` job executes the PR creation AFTER the agent job ends. If the MCP session expires before you record the intent, the `safe_outputs` job is SKIPPED and all work is lost.
26692676
26702677
### Layer 3: MCP Gateway Diagnostics (run when tools fail)
26712678
@@ -2932,9 +2939,9 @@ echo "=== 🔍 Analysis Enrichment Verification Gate ==="
29322939
for f in "$ANALYSIS_DIR"/*.md; do
29332940
[ ! -f "$f" ] && continue
29342941
# Skip the factual data-download-manifest.md — its script marker is expected and not a stub
2935-
FBASE=$(basename "$f")
2936-
case "$FBASE" in
2937-
data-download-manifest.md) echo "⏭️ SKIP (factual manifest): $f"; continue ;;
2942+
# AWF-safe: use `$f` path-pattern tests instead of $(basename "$f")
2943+
case "$f" in
2944+
*/data-download-manifest.md) echo "⏭️ SKIP (factual manifest): $f"; continue ;;
29382945
esac
29392946
# Match the legacy `pre-article-analysis script` marker present in historical stub files.
29402947
# The current download script writes only the factual `data-download-manifest.md` (skipped above),

.github/aw/actions-lock.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@
4040
"version": "v7.0.1",
4141
"sha": "043fb46d1a93c77aae656e7c1c64a875d1fc6a0a"
4242
},
43-
"github/gh-aw-actions/setup-cli@v0.68.7": {
43+
"github/gh-aw-actions/setup-cli@v0.69.0": {
4444
"repo": "github/gh-aw-actions/setup-cli",
45-
"version": "v0.68.7",
46-
"sha": "f52802884d655622f0a2dfd6d6a2250983c95523"
45+
"version": "v0.69.0",
46+
"sha": "81b86c58b134601fc10d4745e276d7861cd12911"
4747
},
48-
"github/gh-aw-actions/setup@v0.68.7": {
48+
"github/gh-aw-actions/setup@v0.69.0": {
4949
"repo": "github/gh-aw-actions/setup",
50-
"version": "v0.68.7",
51-
"sha": "f52802884d655622f0a2dfd6d6a2250983c95523"
50+
"version": "v0.69.0",
51+
"sha": "81b86c58b134601fc10d4745e276d7861cd12911"
5252
},
5353
"github/gh-aw/actions/setup@v0.43.18": {
5454
"repo": "github/gh-aw/actions/setup",

.github/workflows/agentics-maintenance.yml

Lines changed: 104 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# \ /\ / (_) | | | | ( | | | | (_) \ V V /\__ \
1313
# \/ \/ \___/|_| |_|\_\|_| |_|\___/ \_/\_/ |___/
1414
#
15-
# This file was automatically generated by pkg/workflow/maintenance_workflow.go (v0.68.7). DO NOT EDIT.
15+
# This file was automatically generated by pkg/workflow/maintenance_workflow.go (v0.69.0). DO NOT EDIT.
1616
#
1717
# To regenerate this workflow, run:
1818
# gh aw compile
@@ -50,6 +50,8 @@ on:
5050
- 'upgrade'
5151
- 'safe_outputs'
5252
- 'create_labels'
53+
- 'activity_report'
54+
- 'close_agentic_workflows_issues'
5355
- 'clean_cache_memories'
5456
- 'validate'
5557
run_url:
@@ -60,7 +62,7 @@ on:
6062
workflow_call:
6163
inputs:
6264
operation:
63-
description: 'Optional maintenance operation to run (disable, enable, update, upgrade, safe_outputs, create_labels, clean_cache_memories, validate)'
65+
description: 'Optional maintenance operation to run (disable, enable, update, upgrade, safe_outputs, create_labels, activity_report, close_agentic_workflows_issues, clean_cache_memories, validate)'
6466
required: false
6567
type: string
6668
default: ''
@@ -89,7 +91,7 @@ jobs:
8991
pull-requests: write
9092
steps:
9193
- name: Setup Scripts
92-
uses: github/gh-aw-actions/setup@f52802884d655622f0a2dfd6d6a2250983c95523 # v0.68.7
94+
uses: github/gh-aw-actions/setup@81b86c58b134601fc10d4745e276d7861cd12911 # v0.69.0
9395
with:
9496
destination: ${{ runner.temp }}/gh-aw/actions
9597

@@ -127,7 +129,7 @@ jobs:
127129
actions: write
128130
steps:
129131
- name: Setup Scripts
130-
uses: github/gh-aw-actions/setup@f52802884d655622f0a2dfd6d6a2250983c95523 # v0.68.7
132+
uses: github/gh-aw-actions/setup@81b86c58b134601fc10d4745e276d7861cd12911 # v0.69.0
131133
with:
132134
destination: ${{ runner.temp }}/gh-aw/actions
133135

@@ -141,7 +143,7 @@ jobs:
141143
await main();
142144
143145
run_operation:
144-
if: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') && inputs.operation != '' && inputs.operation != 'safe_outputs' && inputs.operation != 'create_labels' && inputs.operation != 'clean_cache_memories' && inputs.operation != 'validate' && (!(github.event.repository.fork)) }}
146+
if: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') && inputs.operation != '' && inputs.operation != 'safe_outputs' && inputs.operation != 'create_labels' && inputs.operation != 'activity_report' && inputs.operation != 'close_agentic_workflows_issues' && inputs.operation != 'clean_cache_memories' && inputs.operation != 'validate' && (!(github.event.repository.fork)) }}
145147
runs-on: ubuntu-slim
146148
permissions:
147149
actions: write
@@ -156,7 +158,7 @@ jobs:
156158
persist-credentials: false
157159

158160
- name: Setup Scripts
159-
uses: github/gh-aw-actions/setup@f52802884d655622f0a2dfd6d6a2250983c95523 # v0.68.7
161+
uses: github/gh-aw-actions/setup@81b86c58b134601fc10d4745e276d7861cd12911 # v0.69.0
160162
with:
161163
destination: ${{ runner.temp }}/gh-aw/actions
162164

@@ -171,9 +173,9 @@ jobs:
171173
await main();
172174
173175
- name: Install gh-aw
174-
uses: github/gh-aw-actions/setup-cli@f52802884d655622f0a2dfd6d6a2250983c95523 # v0.68.7
176+
uses: github/gh-aw-actions/setup-cli@81b86c58b134601fc10d4745e276d7861cd12911 # v0.69.0
175177
with:
176-
version: v0.68.7
178+
version: v0.69.0
177179

178180
- name: Run operation
179181
uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
@@ -213,7 +215,7 @@ jobs:
213215
persist-credentials: false
214216

215217
- name: Setup Scripts
216-
uses: github/gh-aw-actions/setup@f52802884d655622f0a2dfd6d6a2250983c95523 # v0.68.7
218+
uses: github/gh-aw-actions/setup@81b86c58b134601fc10d4745e276d7861cd12911 # v0.69.0
217219
with:
218220
destination: ${{ runner.temp }}/gh-aw/actions
219221

@@ -257,7 +259,7 @@ jobs:
257259
persist-credentials: false
258260

259261
- name: Setup Scripts
260-
uses: github/gh-aw-actions/setup@f52802884d655622f0a2dfd6d6a2250983c95523 # v0.68.7
262+
uses: github/gh-aw-actions/setup@81b86c58b134601fc10d4745e276d7861cd12911 # v0.69.0
261263
with:
262264
destination: ${{ runner.temp }}/gh-aw/actions
263265

@@ -272,9 +274,9 @@ jobs:
272274
await main();
273275
274276
- name: Install gh-aw
275-
uses: github/gh-aw-actions/setup-cli@f52802884d655622f0a2dfd6d6a2250983c95523 # v0.68.7
277+
uses: github/gh-aw-actions/setup-cli@81b86c58b134601fc10d4745e276d7861cd12911 # v0.69.0
276278
with:
277-
version: v0.68.7
279+
version: v0.69.0
278280

279281
- name: Create missing labels
280282
uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
@@ -288,6 +290,93 @@ jobs:
288290
const { main } = require('${{ runner.temp }}/gh-aw/actions/create_labels.cjs');
289291
await main();
290292
293+
activity_report:
294+
if: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') && inputs.operation == 'activity_report' && (!(github.event.repository.fork)) }}
295+
runs-on: ubuntu-slim
296+
timeout-minutes: 120
297+
permissions:
298+
actions: read
299+
contents: read
300+
issues: write
301+
steps:
302+
- name: Checkout repository
303+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
304+
with:
305+
persist-credentials: false
306+
307+
- name: Setup Scripts
308+
uses: github/gh-aw-actions/setup@81b86c58b134601fc10d4745e276d7861cd12911 # v0.69.0
309+
with:
310+
destination: ${{ runner.temp }}/gh-aw/actions
311+
312+
- name: Check admin/maintainer permissions
313+
uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
314+
with:
315+
github-token: ${{ secrets.GITHUB_TOKEN }}
316+
script: |
317+
const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
318+
setupGlobals(core, github, context, exec, io, getOctokit);
319+
const { main } = require('${{ runner.temp }}/gh-aw/actions/check_team_member.cjs');
320+
await main();
321+
322+
- name: Install gh-aw
323+
uses: github/gh-aw-actions/setup-cli@81b86c58b134601fc10d4745e276d7861cd12911 # v0.69.0
324+
with:
325+
version: v0.69.0
326+
327+
- name: Cache activity report logs
328+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
329+
with:
330+
path: ./.cache/gh-aw/activity-report-logs
331+
key: ${{ runner.os }}-activity-report-logs-${{ github.repository }}-${{ github.ref_name }}-${{ github.run_id }}
332+
restore-keys: |
333+
${{ runner.os }}-activity-report-logs-${{ github.repository }}-
334+
${{ runner.os }}-activity-report-logs-
335+
- name: Generate agentic workflow activity report
336+
uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
337+
env:
338+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
339+
GH_AW_CMD_PREFIX: gh aw
340+
GH_AW_ACTIVITY_REPORT_OUTPUT_DIR: ./.cache/gh-aw/activity-report-logs
341+
with:
342+
github-token: ${{ secrets.GITHUB_TOKEN }}
343+
script: |
344+
const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
345+
setupGlobals(core, github, context, exec, io, getOctokit);
346+
const { main } = require('${{ runner.temp }}/gh-aw/actions/run_activity_report.cjs');
347+
await main();
348+
349+
close_agentic_workflows_issues:
350+
if: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') && inputs.operation == 'close_agentic_workflows_issues' && (!(github.event.repository.fork)) }}
351+
runs-on: ubuntu-slim
352+
permissions:
353+
issues: write
354+
steps:
355+
- name: Setup Scripts
356+
uses: github/gh-aw-actions/setup@81b86c58b134601fc10d4745e276d7861cd12911 # v0.69.0
357+
with:
358+
destination: ${{ runner.temp }}/gh-aw/actions
359+
360+
- name: Check admin/maintainer permissions
361+
uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
362+
with:
363+
github-token: ${{ secrets.GITHUB_TOKEN }}
364+
script: |
365+
const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
366+
setupGlobals(core, github, context, exec, io, getOctokit);
367+
const { main } = require('${{ runner.temp }}/gh-aw/actions/check_team_member.cjs');
368+
await main();
369+
370+
- name: Close no-repro agentic-workflows issues
371+
uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
372+
with:
373+
github-token: ${{ secrets.GITHUB_TOKEN }}
374+
script: |
375+
const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
376+
setupGlobals(core, github, context, exec, io, getOctokit);
377+
const { main } = require('${{ runner.temp }}/gh-aw/actions/close_agentic_workflows_issues.cjs');
378+
await main();
379+
291380
validate_workflows:
292381
if: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') && inputs.operation == 'validate' && (!(github.event.repository.fork)) }}
293382
runs-on: ubuntu-latest
@@ -301,7 +390,7 @@ jobs:
301390
persist-credentials: false
302391

303392
- name: Setup Scripts
304-
uses: github/gh-aw-actions/setup@f52802884d655622f0a2dfd6d6a2250983c95523 # v0.68.7
393+
uses: github/gh-aw-actions/setup@81b86c58b134601fc10d4745e276d7861cd12911 # v0.69.0
305394
with:
306395
destination: ${{ runner.temp }}/gh-aw/actions
307396

@@ -316,9 +405,9 @@ jobs:
316405
await main();
317406
318407
- name: Install gh-aw
319-
uses: github/gh-aw-actions/setup-cli@f52802884d655622f0a2dfd6d6a2250983c95523 # v0.68.7
408+
uses: github/gh-aw-actions/setup-cli@81b86c58b134601fc10d4745e276d7861cd12911 # v0.69.0
320409
with:
321-
version: v0.68.7
410+
version: v0.69.0
322411

323412
- name: Validate workflows and file issue on findings
324413
uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9

0 commit comments

Comments
 (0)