Improve political intelligence depth in news articles and workflows#1509
Improve political intelligence depth in news articles and workflows#1509
Conversation
…, political intelligence depth requirements, quality issues, and script role boundary Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/0762a10a-cf54-44e3-8d3f-085e6cf59a62 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
… 8-stakeholder SWOT, Mermaid/risk/forward indicator requirements Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/0762a10a-cf54-44e3-8d3f-085e6cf59a62 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
…r ai-driven-analysis-guide.md Rule 2 Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/0762a10a-cf54-44e3-8d3f-085e6cf59a62 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
…eview feedback) Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/0762a10a-cf54-44e3-8d3f-085e6cf59a62 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
🏷️ Automatic Labeling SummaryThis PR has been automatically labeled based on the files changed and PR metadata. Applied Labels: documentation,workflow,ci-cd,refactor,size-l,news,agentic-workflow Label Categories
For more information, see |
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
… deprecated content generators, THEME_COLORS, and 19 test files Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/e8be0c62-6c4e-47df-8c0a-786f48e11ceb Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
There was a problem hiding this comment.
Pull request overview
This PR removes deprecated AI analysis/framework modules and related tests, updates the browser theme/chart utilities to drop the deprecated THEME_COLORS alias, and tightens the “news” workflow prompt docs to require deeper, more structured political analysis output.
Changes:
- Deleted deprecated
scripts/ai-analysis/+scripts/analysis-framework/code and associated Vitest test suites. - Removed
THEME_COLORSexport and re-export from the browser theme/chart utility layer. - Expanded workflow prompt requirements (stakeholder coverage, Mermaid diagrams, risk matrices, forward indicators, and isolation rules).
Reviewed changes
Copilot reviewed 54 out of 59 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/generate-news-generators.test.ts | Removed unit tests for enhanced news generators. |
| tests/generate-news-enhanced-integration.test.ts | Removed integration tests for template/quality/leakage checks. |
| tests/coalition-detector.test.ts | Removed tests for coalition tension heuristics. |
| tests/analysis-integration.test.ts | Removed integration tests for analysis/content generator bridge. |
| tests/ai-visualisation.test.ts | Removed tests for mindmap/dashboard builders. |
| tests/ai-urgency-classifier.test.ts | Removed tests for watch points/policy assessment labels. |
| tests/ai-swot-builder.test.ts | Removed tests for SWOT builder + localisation records. |
| tests/ai-swot-analyzer.test.ts | Removed tests for AI SWOT stakeholder builder. |
| tests/ai-coalition-detector.test.ts | Removed interface-level tests for coalition detector. |
| src/browser/shared/theme.ts | Removed deprecated THEME_COLORS alias; comments updated to point to runtime theme selection. |
| src/browser/shared/chart-factory.ts | Dropped import/re-export of THEME_COLORS from the chart factory convenience exports. |
| scripts/data-transformers/content-generators/stakeholder-swot-section.ts | Deleted stakeholder SWOT section generator module. |
| scripts/analysis-framework/types.ts | Deleted analysis framework type definitions. |
| scripts/analysis-framework/significance-scorer.ts | Deleted framework significance/confidence scoring implementation. |
| scripts/analysis-framework/methodology-types.ts | Deleted methodology type system (classification/risk/threat). |
| scripts/analysis-framework/lenses/opposition.ts | Deleted opposition lens implementation. |
| scripts/analysis-framework/lenses/media.ts | Deleted media lens implementation. |
| scripts/analysis-framework/lenses/international.ts | Deleted international lens implementation. |
| scripts/analysis-framework/lenses/government.ts | Deleted government lens implementation. |
| scripts/analysis-framework/lenses/economic.ts | Deleted economic lens implementation. |
| scripts/analysis-framework/lenses/citizen.ts | Deleted citizen lens implementation. |
| scripts/analysis-framework/index.ts | Deleted framework orchestrator and re-exports. |
| scripts/analysis-framework/cross-reference.ts | Deleted cross-document relationship detection implementation. |
| scripts/ai-analysis/visualisation/index.ts | Deleted AI visualisation builders (mindmap/dashboard). |
| scripts/ai-analysis/types.ts | Deleted AI pipeline type definitions. |
| scripts/ai-analysis/political-significance.ts | Deleted political significance scoring implementation. |
| scripts/ai-analysis/pipeline.ts | Deleted AI analysis pipeline orchestrator. |
| scripts/ai-analysis/index.ts | Deleted barrel exports for AI analysis module. |
| scripts/ai-analysis/helpers.ts | Deleted AI analysis helper utilities. |
| scripts/ai-analysis/coalition-detector.ts | Deleted coalition detector implementation. |
| .github/workflows/news-translate.md | Updated analysis depth gate requirements to include Mermaid diagrams + stakeholder minimums. |
| .github/workflows/news-realtime-monitor.md | Added “Article Type Isolation” rule; expanded depth gate to include risk matrix + indicators. |
| .github/workflows/news-motions.md | Added isolation rule; expanded depth gate and editorial profile requirements (8 stakeholders, risk, indicators). |
| .github/workflows/news-month-ahead.md | Added isolation rule; expanded depth gate and editorial profile requirements (8 stakeholders, risk, indicators). |
| .github/workflows/news-interpellations.md | Added isolation rule; expanded depth gate and editorial profile requirements (8 stakeholders, risk, indicators). |
| .github/workflows/news-evening-analysis.md | Added isolation rule; expanded depth gate and editorial profile requirements (8 stakeholders, risk, indicators). |
| .github/workflows/news-committee-reports.md | Added isolation rule; expanded depth gate and editorial profile requirements (8 stakeholders, risk, indicators). |
| .github/workflows/news-article-generator.md | Added isolation rule; expanded depth gate requirements (risk matrix + indicators + 8 stakeholders). |
src/browser/shared/chart-factory.ts
Outdated
|
|
||
| import type { Chart as ChartType, ChartConfiguration, ChartTypeRegistry } from 'chart.js'; | ||
| import { THEME_COLORS, CHART_PALETTE, BREAKPOINTS, getActiveThemeColors, getChartPalette } from './theme.js'; | ||
| import { CHART_PALETTE, BREAKPOINTS, getActiveThemeColors, getChartPalette } from './theme.js'; |
There was a problem hiding this comment.
Removing the THEME_COLORS re-export from this “convenience” module is a breaking API change for any callers importing THEME_COLORS from chart-factory.ts. If you want to keep the deprecation removal, consider providing a temporary compatibility export (deprecated) for one release cycle (e.g., re-export DARK_THEME_COLORS under the old name) or update the public-facing module contract to make consumers migrate to getActiveThemeColors() without runtime breakage.
| export { THEME_COLORS, CHART_PALETTE, BREAKPOINTS, getActiveThemeColors, getChartPalette }; | ||
| export { CHART_PALETTE, BREAKPOINTS, getActiveThemeColors, getChartPalette }; | ||
|
|
||
| /** |
There was a problem hiding this comment.
Removing the THEME_COLORS re-export from this “convenience” module is a breaking API change for any callers importing THEME_COLORS from chart-factory.ts. If you want to keep the deprecation removal, consider providing a temporary compatibility export (deprecated) for one release cycle (e.g., re-export DARK_THEME_COLORS under the old name) or update the public-facing module contract to make consumers migrate to getActiveThemeColors() without runtime breakage.
| /** | |
| /** | |
| * @deprecated Use getActiveThemeColors() instead. | |
| * Temporary compatibility export to avoid breaking callers that import THEME_COLORS | |
| * from this convenience module. | |
| */ | |
| export const THEME_COLORS = getActiveThemeColors(); | |
| /** |
|
|
||
| ### Article Type Isolation | ||
|
|
||
| > 🚨 **This workflow writes analysis ONLY to `analysis/daily/${ARTICLE_DATE}/committeeReports/`**. NEVER write to the parent date directory or another article type's folder. See SHARED_PROMPT_PATTERNS.md "Article Type Isolation" section. |
There was a problem hiding this comment.
The new target directory uses committeeReports/ (camelCase), while other workflow docs in this PR use kebab-case or lowercase folder names (e.g., motions/, interpellations/, month-ahead/). If these paths are used as hard constraints for where automation writes outputs, this inconsistency can cause analysis artifacts to be written to the wrong location or split across multiple directories. Standardize directory naming across workflows (prefer a single convention) and ensure it matches the actual generator/output paths.
| > 🚨 **This workflow writes analysis ONLY to `analysis/daily/${ARTICLE_DATE}/committeeReports/`**. NEVER write to the parent date directory or another article type's folder. See SHARED_PROMPT_PATTERNS.md "Article Type Isolation" section. | |
| > 🚨 **This workflow writes analysis ONLY to `analysis/daily/${ARTICLE_DATE}/committee-reports/`**. NEVER write to the parent date directory or another article type's folder. See SHARED_PROMPT_PATTERNS.md "Article Type Isolation" section. |
| | Depth | AI iterations | SWOT stakeholders | Charts | Mindmap | Mermaid diagrams | Risk matrix (L×I) | Forward indicators | Min. analysis time | | ||
| |-------|--------------|-------------------|--------|---------|-----------------|-------------------|-------------------|-------------------| | ||
| | standard | 1-2 | ≥5 (of 8 groups) | ≥1 | optional | ≥1 color-coded | ≥2 risks scored | ≥2 with triggers | 10 minutes | |
There was a problem hiding this comment.
The table rows are prefixed with ||, which renders as an extra empty leading column in Markdown tables on GitHub. Since these lines were modified in this PR, it’s a good opportunity to correct the table formatting by using a single leading pipe (|) (or no leading pipe at all) consistently across all rows so column alignment is unambiguous.
|
|
||
| ### Article Type Isolation | ||
|
|
||
| > 🚨 **This workflow writes analysis ONLY to `analysis/daily/${ARTICLE_DATE}/${REQUESTED_TYPE}/`**. NEVER write to the parent date directory or another article type's folder. See SHARED_PROMPT_PATTERNS.md "Article Type Isolation" section. |
There was a problem hiding this comment.
The PR description indicates “Phase 3: Add analysis transparency links to SHARED_PROMPT_PATTERNS.md” is not completed, but multiple workflow docs now instruct readers to consult SHARED_PROMPT_PATTERNS.md (including a specific “Article Type Isolation” section). To avoid internal doc drift, either include the corresponding SHARED_PROMPT_PATTERNS.md updates in this PR (so the references resolve), or adjust these references until Phase 3 is actually delivered.
|
@copilot apply changes based on the comments in this thread |
…ypes and stub functions for ai-analysis, analysis-framework, and content-generators Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/e8be0c62-6c4e-47df-8c0a-786f48e11ceb Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
…es to DARK_THEME_COLORS for backward-compat) Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/36ca13c7-0129-4102-ad12-47c8129137d5 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Applied the review feedback in commit
|
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
|
@copilot analyse and fix all issues in TypeScript & JavaScript Testing / Unit Tests (Vitest) (pull_request) |
… stub types, fix StakeholderCategory union Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/25294c5d-0866-4ece-b10b-6d46f41538b6 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
Fixed all TypeScript build errors in commit
All 3932 tests pass, 0 TypeScript errors, 0 CodeQL alerts. |
Summary of changes