-
Notifications
You must be signed in to change notification settings - Fork 2
Fix drift in agentic workflow contract, prompts, and docs #2008
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e1343ba
workflows: 45-min job budget + 30-min PR deadline harmonised across n…
Copilot 1120daf
prompts: dedup 02-mcp-access, drop stale phase-checkpoint refs, fix s…
Copilot c887651
workflows: extract pre-warm/pre-flight to composite action; rewrite g…
Copilot d3014aa
docs: align stale facts (11 not 12 agentic workflows, 43 not 45 files…
Copilot 2da6d5a
docs: add political-intelligence + sitemap links to README, typedoc, …
Copilot 39baad0
fix: address PR review comments — pin setup-node v6.4.0, clarify arti…
Copilot f956aa6
fix: remove duplicate npm package sentence and align analysis-gate to…
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| name: 'News workflow pre-warm & pre-flight' | ||
| description: | | ||
| Shared setup for every `.github/workflows/news-*.md` agentic workflow: | ||
| 1. Set up Node.js 25 (matches `runtimes.node.version` in every workflow). | ||
| 2. `npm ci --prefer-offline --no-audit`. | ||
| 3. Pre-warm the riksdag-regering MCP server (Render.com cold-start mitigation). | ||
| 4. Pre-flight DNS + HTTPS reachability + MCP `tools/list` probe for the | ||
| upstream services consumed by the news pipeline. | ||
|
|
||
| This action exists to deduplicate ~80 lines of identical YAML across the 11 | ||
| news workflow files. Edit it in one place. | ||
| inputs: | ||
| node-version: | ||
| description: 'Node.js version (must match the workflow `runtimes.node.version`).' | ||
| required: false | ||
| default: '25' | ||
| mcp-url: | ||
| description: 'Riksdag-regering MCP HTTP endpoint to pre-warm.' | ||
| required: false | ||
| default: 'https://riksdag-regering-ai.onrender.com/mcp' | ||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | ||
| with: | ||
| node-version: ${{ inputs.node-version }} | ||
|
|
||
| - name: Install dependencies | ||
| shell: bash | ||
| run: npm ci --prefer-offline --no-audit | ||
|
|
||
| - name: Pre-warm MCP server (Render.com cold start mitigation) | ||
| shell: bash | ||
| env: | ||
| MCP_URL: ${{ inputs.mcp-url }} | ||
| run: | | ||
| echo "🔥 Pre-warming riksdag-regering MCP server via MCP protocol..." | ||
| WARM=false | ||
| for i in 1 2 3 4 5 6; do | ||
| RESP=$(curl -sf --max-time 30 -X POST \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' \ | ||
| "$MCP_URL" 2>/dev/null) || true | ||
| if echo "$RESP" | grep -q '"tools"'; then | ||
| TOOL_COUNT=$(echo "$RESP" | grep -o '"name"' | wc -l) | ||
| echo "✅ MCP server responded on attempt $i with $TOOL_COUNT tools registered" | ||
| WARM=true | ||
| break | ||
| fi | ||
| echo "⏳ Attempt $i/6 — server may be cold-starting, waiting 20s..." | ||
| sleep 20 | ||
| done | ||
| if [ "$WARM" = "false" ]; then | ||
| echo "⚠️ MCP server did not respond after 6 attempts — agent will retry via in-prompt health gate" | ||
| fi | ||
|
|
||
| - name: Pre-flight external endpoint reachability check (runs before MCP Gateway) | ||
| shell: bash | ||
| env: | ||
| MCP_URL: ${{ inputs.mcp-url }} | ||
| run: | | ||
| echo "🔍 Network Diagnostics — $(date -u '+%Y-%m-%dT%H:%M:%SZ')" | ||
| echo "═══════════════════════════════════════════" | ||
| echo "" | ||
| echo "📡 DNS Resolution Tests:" | ||
| for domain in riksdag-regering-ai.onrender.com api.scb.se api.worldbank.org data.riksdagen.se www.riksdagen.se www.regeringen.se www.statskontoret.se statskontoret.se; do | ||
| if nslookup "$domain" >/dev/null 2>&1; then | ||
| IP=$(nslookup "$domain" 2>/dev/null | grep -A1 "Name:" | grep "Address:" | head -1 | awk '{print $2}') | ||
| echo " ✅ $domain → $IP" | ||
| else | ||
| echo " ❌ $domain — DNS FAILED" | ||
| fi | ||
| done | ||
| echo "" | ||
| echo "🌐 HTTPS Connectivity Tests:" | ||
| for url in \ | ||
| "$MCP_URL" \ | ||
| "https://api.scb.se/OV0104/v2beta" \ | ||
| "https://api.worldbank.org/v2/country/SE?format=json" \ | ||
| "https://data.riksdagen.se/dokumentlista/?sok=test&doktyp=bet&utformat=json&a=1" \ | ||
| ; do | ||
| HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" --max-time 10 "$url" 2>/dev/null || echo "000") | ||
| DOMAIN=$(echo "$url" | sed 's|https://||' | cut -d/ -f1) | ||
| if [ "$HTTP_CODE" -ge 200 ] && [ "$HTTP_CODE" -lt 400 ]; then | ||
| echo " ✅ $DOMAIN → HTTP $HTTP_CODE" | ||
| elif [ "$HTTP_CODE" = "000" ]; then | ||
| echo " ❌ $DOMAIN → TIMEOUT/UNREACHABLE" | ||
| else | ||
| echo " ⚠️ $DOMAIN → HTTP $HTTP_CODE" | ||
| fi | ||
| done | ||
| echo "" | ||
| echo "🔌 MCP Server Tool Count:" | ||
| TOOL_RESP=$(curl -sf --max-time 15 -X POST \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' \ | ||
| "$MCP_URL" 2>/dev/null) || TOOL_RESP="" | ||
| if echo "$TOOL_RESP" | grep -q '"tools"'; then | ||
| TOOL_COUNT=$(echo "$TOOL_RESP" | grep -o '"name"' | wc -l) | ||
| echo " ✅ riksdag-regering MCP: $TOOL_COUNT tools registered" | ||
| else | ||
| echo " ❌ riksdag-regering MCP: No tools response (server may still be starting)" | ||
| fi | ||
| echo "" | ||
| echo "═══════════════════════════════════════════" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pre-flight loop breaks on the first missing artifact, so
COUNTis the number of items checked up to the first missing file, not the total required-artifact count. The log line can therefore be misleading (e.g., it may printcount: 7even though 23 artifacts are required). Consider emitting a constant expected count (23) and/or tracking a separateEXPECTED=23vsCHECKED=$COUNTto keep the output accurate for debugging.