Consistent EU doc classification and AI analysis pipeline cleanup#1166
Merged
Consistent EU doc classification and AI analysis pipeline cleanup#1166
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
generators.tsleftover legacy references/redeclarations in deep-inspection sectionsconst filteredsnippet in.github/workflows/news-evening-analysis.mdOriginal prompt
This section details on the original issue you should resolve
<issue_title>Redesign Article Generator Architecture for AI-First Multi-Iteration Analysis</issue_title>
<issue_description>## 📋 Issue Type
Feature / Architecture Redesign
🎯 Objective
Fundamentally redesign the news article generation architecture (
scripts/generate-news-enhanced/generators.ts) so that all political analysis content is AI-generated through multiple LLM iterations rather than being produced by static TypeScript templates with hardcoded text. The current architecture uses template-based generators that produce static SWOT entries, dashboard text, and analysis paragraphs. This must shift to an AI-first pipeline where templates provide consistent HTML structure/styling, but all analytical content (SWOT analysis, political assessments, stakeholder perspectives, policy implications) is generated by the AI agent with iterative quality refinement.📊 Current State
generators.ts(1690 lines): Generators (generateWeekAhead,generateCommitteeReports,generatePropositions,generateMotions,generateDeepInspection) produce content by callinggenerateArticleContent()fromdata-transformers.tswhich uses hardcoded template strings for analysisbuildDeepInspectionSections(): Creates SWOT entries from document metadata titles and hardcodedSWOT_DEFAULTSmap with template strings like"Policy initiative and agenda-setting on %t"— this is NOT AI analysisgenerateDeepInspectionContent(): Generates content sections using document titles/types rather than deep AI-powered analysis of document content🚀 Desired State
🔧 Implementation Approach
Phase 1: Create AI Analysis Pipeline Interface
Phase 2: Refactor Generator Functions
generators.tslines 1069-1086 into AI analysis promptsbuildDeepInspectionSections()withpipeline.analyzeDocuments()generateDeepInspectionContent()with AI-generated narrative that references actual document contentgenerateArticleHTML()template rendering unchanged (consistent styling)Phase 3: Integrate AI Iterations in Agentic Workflows
.github/workflows/news-*.mdto include analysis depth parametersnews/metadata/for audit trailPhase 4: Apply to All Article Types
🤖 Recommended Agent
code-quality-engineer — This is a major architectural refactoring of the generator pipeline requiring careful decomposition of the existing 1690-line generators.ts into a clean AI-first architecture while preserving backward compatibility with all 12 agentic workflows.
✅ Acceptance Criteria
scripts/ai-analysis/pipeline.tsmodule with typed interfaces for AI analysis pipeline💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.