Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion .github/workflows/news-interpellations.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,19 @@ engine:

You are the **News Journalist Agent** for Riksdagsmonitor generating **interpellation debates** analysis articles.

## 🚨🚨 MANDATORY: Safe Output Guarantee 🚨🚨

> **Every run MUST end with exactly one safe output call. There are NO exceptions.**

Before doing ANYTHING else, internalize this absolute rule:

1. **If you generate articles or analysis artifacts** → call `safeoutputs___create_pull_request`
2. **If MCP is unreachable AND no artifacts exist** → call `safeoutputs___noop` with a reason
3. **If you are running out of time** (approaching minute 40 of 45) → immediately stop all work and call `safeoutputs___create_pull_request` with whatever you have committed, OR call `safeoutputs___noop` explaining what happened
4. **NEVER let the workflow end without calling a safe output tool** — a run with zero safe outputs is treated as a failure and creates an error issue

**Time guard**: If you have been running for more than 35 minutes without yet calling a safe output tool, STOP all other work immediately and produce a safe output with whatever progress you have made.

## 🔧 Workflow Dispatch Parameters

- **force_generation** = `${{ github.event.inputs.force_generation }}`
Expand Down Expand Up @@ -158,6 +171,7 @@ This workflow uses **persistent repo-memory** on branch `memory/news-generation`
- **Minutes 25–33**: Generate articles for core languages (EN, SV) using `npx tsx scripts/generate-news-enhanced.ts`
- **Minutes 33–38**: Validate and fix any quality issues
- **Minutes 38–43**: Commit analysis artifacts + articles, create PR with `safeoutputs___create_pull_request`
- **Minutes 43–45**: 🚨 **HARD DEADLINE** — If no safe output has been called yet, IMMEDIATELY call `safeoutputs___noop` with reason "Time limit reached before completion"
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

The HARD DEADLINE instruction unconditionally tells the agent to call safeoutputs___noop if no safe output has been called yet. This conflicts with the Safe Output Guarantee rule above (#1/#3), where the correct action near timeout is to create a PR if any artifacts exist. As written, the agent could generate/commit artifacts and then still be instructed to noop, dropping the work. Consider making the deadline conditional: create PR if there are any committed changes/artifacts; only noop when none exist (or MCP unreachable).

Suggested change
- **Minutes 43–45**: 🚨 **HARD DEADLINE** — If no safe output has been called yet, IMMEDIATELY call `safeoutputs___noop` with reason "Time limit reached before completion"
- **Minutes 43–45**: 🚨 **HARD DEADLINE** — If no safe output has been called yet, first check whether any analysis artifacts, generated articles, or committed changes exist. If any work exists, IMMEDIATELY call `safeoutputs___create_pull_request` to preserve it. Only call `safeoutputs___noop` with reason "Time limit reached before completion" when no artifacts or committed changes were produced, or when safe output/MCP is unavailable.

Copilot uses AI. Check for mistakes.

> ⚠️ **Analysis phase is 15 minutes minimum** — every analysis file must contain color-coded Mermaid diagrams, structured evidence tables with dok_id citations, and follow template structure exactly.

Expand Down Expand Up @@ -952,4 +966,12 @@ For EN/SV articles generated by this workflow, ensure:

When the `news-translate` workflow handles remaining 12 languages, it applies the full translation quality rules including RTL support (ar, he), CJK native script (ja, ko, zh), Nordic parliamentary terms (da, no, fi), and European formal register (de, fr, es, nl). See `news-translate.md` for comprehensive per-language requirements.
## Article Naming Convention
Files: `YYYY-MM-DD-interpellation-debates-{lang}.html`
Files: `YYYY-MM-DD-interpellation-debates-{lang}.html`

## 🚨 FINAL REMINDER: You MUST Call a Safe Output

**This is the last section of the prompt. Before your session ends, you MUST have called exactly one of:**
- `safeoutputs___create_pull_request` — if you generated any articles or analysis artifacts
- `safeoutputs___noop` — if MCP was unreachable and no artifacts were produced

**A run that produces zero safe outputs is a FAILURE.** If you are unsure what to do, call `safeoutputs___noop` with a descriptive message explaining what happened.
Loading