Add per-type news workflows, fix TS errors, compile all lock files#426
Add per-type news workflows, fix TS errors, compile all lock files#426
Conversation
…ith tests Co-authored-by: pethers <[email protected]>
…hedule, add architecture tests Co-authored-by: pethers <[email protected]>
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
… dispatcher, add tests Co-authored-by: pethers <[email protected]>
Co-authored-by: pethers <[email protected]>
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
There was a problem hiding this comment.
Pull request overview
This pull request addresses CI failures in news generation workflows by decomposing the monolithic multi-type generator into 7 focused per-type workflows. The architecture change prevents safe_outputs patch size limit failures (~1MB maxBuffer) that occurred when generating all article types in a single run across 14 languages.
Changes:
- Split news generation into 7 dedicated scheduled workflows (committee-reports, propositions, motions, week-ahead, month-ahead, weekly-review, monthly-review), each generating one article type across 14 languages with staggered cron schedules
- Added 3 new article type modules (month-ahead, weekly-review, monthly-review) with full test coverage (36 new tests)
- Extended type system with new ArticleType variants and documents property in ArticleContentData interface for review-type articles
Reviewed changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/news-committee-reports.md |
New dedicated workflow for committee-reports (04:00 UTC Mon-Fri) |
.github/workflows/news-propositions.md |
New dedicated workflow for propositions (05:00 UTC Mon-Fri) |
.github/workflows/news-motions.md |
New dedicated workflow for motions (06:00 UTC Mon-Fri) |
.github/workflows/news-week-ahead.md |
New dedicated workflow for week-ahead (07:00 UTC Fri) |
.github/workflows/news-month-ahead.md |
New dedicated workflow for month-ahead (08:00 UTC 1st of month) |
.github/workflows/news-weekly-review.md |
New dedicated workflow for weekly-review (09:00 UTC Sat) |
.github/workflows/news-monthly-review.md |
New dedicated workflow for monthly-review (10:00 UTC 28th) |
.github/workflows/news-article-generator.md |
Updated to workflow_dispatch only (no schedule), now manual-only multi-type generator |
scripts/news-types/month-ahead.ts |
New module for month-ahead articles (30-day calendar outlook) |
scripts/news-types/weekly-review.ts |
New module for weekly-review articles (7-day retrospective) |
scripts/news-types/monthly-review.ts |
New module for monthly-review articles (30-day retrospective) |
scripts/types/article.ts |
Extended ArticleType union with month-ahead, weekly-review, monthly-review |
scripts/data-transformers.ts |
Added documents property to ArticleContentData for review articles |
scripts/generate-news-enhanced.ts |
Added dispatcher cases for 3 new article types, updated VALID_ARTICLE_TYPES array |
tests/workflow-architecture.test.ts |
New test suite (14 tests) validating workflow architecture, schedule staggering, type completeness |
tests/news-types/month-ahead.test.ts |
Test suite for month-ahead module (13 test groups) |
tests/news-types/weekly-review.test.ts |
Test suite for weekly-review module (8 test groups) |
tests/news-types/monthly-review.test.ts |
Test suite for monthly-review module (8 test groups) |
tests/generate-news-enhanced-part1.test.ts |
Updated to verify new article types in VALID_ARTICLE_TYPES |
tests/data-transformers.test.ts |
Added tests for documents property handling in review articles |
| - "*.se" | ||
| - "*.com" | ||
| - "*.org" | ||
| - "*.io" | ||
| - default |
There was a problem hiding this comment.
The network.allowed block is overly broad due to wildcard entries like "*.se", "*.com", "*.org", "*.io", plus default, which effectively lets the Copilot agent connect to almost any external host. If the MCP server or other data sources are compromised or abused for prompt injection, they can direct the agent to exfiltrate repository data or tokens to an attacker-controlled domain under these TLDs. Tighten network.allowed to only the specific domains required for this workflow (e.g., the MCP service, GitHub, and official Riksdag/Government endpoints) and remove generic wildcard patterns and unnecessary hosts.
| - "*.se" | |
| - "*.com" | |
| - "*.org" | |
| - "*.io" | |
| - default | |
| - www.riksdagen.se | |
| - www.regeringen.se |
| - "*.se" | ||
| - "*.com" | ||
| - "*.org" | ||
| - "*.io" | ||
| - default |
There was a problem hiding this comment.
The network.allowed configuration uses very broad wildcards like "*.se", "*.com", "*.org", "*.io", and default, allowing the Copilot agent to initiate outbound connections to a wide range of external hosts. In case of a compromised MCP endpoint or successful prompt injection, this enables exfiltration of repository data or credentials to arbitrary attacker-controlled domains within those TLDs. Restrict network.allowed to just the small set of domains actually needed by this workflow (MCP, GitHub, and the official data sources) and drop the wildcard patterns.
| - "*.se" | |
| - "*.com" | |
| - "*.org" | |
| - "*.io" | |
| - default | |
| - www.riksdagen.se | |
| - www.regeringen.se |
| - "*.se" | ||
| - "*.com" | ||
| - "*.org" | ||
| - "*.io" | ||
| - default |
There was a problem hiding this comment.
The network.allowed section includes wildcard hosts such as "*.se", "*.com", "*.org", "*.io", plus default, making outbound network access from the Copilot agent far broader than necessary. If an upstream data source (like the MCP server) is compromised or used for prompt injection, it could instruct the agent to send repository data or tokens to any attacker-controlled domain matching these patterns. Limit network.allowed to the specific required endpoints for propositions generation (MCP, GitHub, and Riksdag/Government APIs) and remove the generic wildcard entries.
| - "*.se" | |
| - "*.com" | |
| - "*.org" | |
| - "*.io" | |
| - default | |
| - www.riksdagen.se | |
| - www.regeringen.se |
| - "*.se" | ||
| - "*.com" | ||
| - "*.org" | ||
| - "*.io" | ||
| - default |
There was a problem hiding this comment.
This workflow's network.allowed list uses broad wildcards like "*.se", "*.com", "*.org", "*.io" together with default, which allows the Copilot agent to connect to almost any host under those TLDs. A compromised MCP response or crafted prompt injection could leverage this to have the agent exfiltrate repository contents or tokens to attacker-controlled domains. Reduce the network.allowed hosts to only the explicit domains actually needed for motions coverage and remove the wildcard patterns to minimize exfiltration risk.
| - "*.se" | |
| - "*.com" | |
| - "*.org" | |
| - "*.io" | |
| - default | |
| - www.riksdagen.se | |
| - www.regeringen.se |
| - "*.se" | ||
| - "*.com" | ||
| - "*.org" | ||
| - "*.io" | ||
| - default |
There was a problem hiding this comment.
The network.allowed configuration here is very permissive, with wildcard entries "*.se", "*.com", "*.org", "*.io" plus default, effectively giving the Copilot agent open egress to many external domains. If the MCP or another data source is compromised or provides malicious prompts, it could direct the agent to send sensitive repository data or tokens to attacker-controlled hosts under those TLDs. Constrain network.allowed to just the explicit domains required for monthly review generation and remove the wildcard and unused hosts.
| - "*.se" | |
| - "*.com" | |
| - "*.org" | |
| - "*.io" | |
| - default | |
| - www.riksdagen.se | |
| - www.regeringen.se |
| - "*.se" | ||
| - "*.com" | ||
| - "*.org" | ||
| - "*.io" | ||
| - default |
There was a problem hiding this comment.
The network.allowed section for this workflow includes wildcard host patterns like "*.se", "*.com", "*.org", "*.io" and default, which is much broader than necessary for month-ahead article generation. This wide egress enables an attacker (via MCP compromise or prompt injection) to have the Copilot agent exfiltrate repository data or tokens to arbitrary domains within those TLDs. Narrow network.allowed down to only the specific endpoints you need (MCP, GitHub, and official data APIs) and eliminate wildcard entries.
| - "*.se" | |
| - "*.com" | |
| - "*.org" | |
| - "*.io" | |
| - default | |
| - www.riksdagen.se | |
| - www.regeringen.se |
| - "*.se" | ||
| - "*.com" | ||
| - "*.org" | ||
| - "*.io" | ||
| - default |
There was a problem hiding this comment.
The network.allowed configuration uses generic wildcard hosts ("*.se", "*.com", "*.org", "*.io") plus default, which effectively gives the Copilot agent broad outbound network access. If an attacker controls or influences an upstream source (e.g., via MCP compromise or prompt injection), they could instruct the agent to send repository data or tokens to attacker-controlled domains that match these wildcards. Restrict network.allowed to a minimal, explicit set of required domains for committee-report generation and remove the wildcard patterns to reduce exfiltration risk.
| - "*.se" | |
| - "*.com" | |
| - "*.org" | |
| - "*.io" | |
| - default | |
| - www.riksdagen.se | |
| - www.regeringen.se |
Co-authored-by: pethers <[email protected]>
…aw compile Co-authored-by: pethers <[email protected]>
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
Agentic news workflows were failing due to safe_outputs patch size limits (multi-article generation exceeded ~1MB maxBuffer), missing article types, and TS compilation errors. New workflow
.mdfiles were not compiled viagh aw compile, so no.lock.ymlfiles existed.Architecture: per-type workflow split
Replaced single
news-article-generator.md(removed schedule, keptworkflow_dispatch) with 7 focused workflows — one article type per run across 14 languages. Staggered cron schedules avoid concurrent runs:news-committee-reportsnews-propositionsnews-motionsnews-week-aheadnews-month-aheadnews-weekly-reviewnews-monthly-reviewNew article types
Added 3 missing types:
month-ahead,weekly-review,monthly-reviewinscripts/news-types/with corresponding test files.TypeScript fixes
documentsproperty toArticleContentDatainterface (used by review types forsearch_dokumentdata)generate-news-enhanced.tsdispatch logicwriteArticlereturn type compatibility (Promise<void | boolean>)Compiled lock files
Fixed schedule frontmatter syntax (
cron:→- cron:array format) and rangh aw compile— all 10 workflows compile cleanly. All 7 new.lock.ymlfiles committed.Tests
month-ahead,weekly-review,monthly-reviewmodulesgenerate-news-enhanceddispatch coverage✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.