feat(monthly-review): multi-month trends, party rankings, and legislative efficiency metrics#610
Draft
feat(monthly-review): multi-month trends, party rankings, and legislative efficiency metrics#610
Conversation
…islative efficiency metrics - Add MonthlyMetrics interface to data-transformers/types.ts - Add generateMonthlyReviewContent to content-generators.ts with 4 new sections in all 14 languages: Month in Numbers, Party Performance Rankings, Legislative Efficiency, and Strategic Outlook - Route monthly-review type to the new generator in data-transformers/index.ts - Fetch previous 2 months for 3-month rolling trend analysis in monthly-review.ts - Compute party rankings from motion/speech parti fields - Compute legislative efficiency rate (reports / propositions) - Extend MonthlyReviewValidationResult with hasPartyRankings, hasLegislativeEfficiency, hasMonthInNumbers fields and corresponding check functions - Add 6 new tests covering all new sections and features Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Enhance monthly review with multi-month trends and metrics
feat(monthly-review): multi-month trends, party rankings, and legislative efficiency metrics
Feb 26, 2026
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
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.
Monthly reviews were functionally identical to weekly reviews — just a longer lookback window with the same generic content pipeline. This PR makes monthly reviews a distinct intelligence product.
New content sections (all 14 languages)
reports / propositions) + opposition motion contextData pipeline changes
Added Step 6 to
generateMonthlyReview: fetches previous 2 months of documents in parallel for trend comparison, then computesMonthlyMetricsinline:Architecture
MonthlyMetricsinterface todata-transformers/types.ts; added optionalmonthlyMetricsfield toArticleContentDatagenerateMonthlyReviewContenttocontent-generators.ts— callsgenerateGenericContentfor the base document list then appends the four new sectionsdata-transformers/index.tsnow routesmonthly-reviewtogenerateMonthlyReviewContentinstead of the shared generic handlerMonthlyReviewValidationResultextended withhasPartyRankings,hasLegislativeEfficiency,hasMonthInNumbersOriginal prompt
This section details on the original issue you should resolve
<issue_title>Improve Monthly Review: Add multi-month trends, party rankings, and legislative efficiency metrics</issue_title>
<issue_description>## 📋 Issue Type
Enhancement — Extend Monthly Review with multi-month trend analysis, party performance rankings, and strategic outlook
🎯 Objective
Enhance
scripts/news-types/monthly-review.tsto provide comprehensive monthly trend analysis, party performance comparative rankings, legislative efficiency metrics, and a forward-looking strategic outlook. Transform monthly reviews from document summaries into the definitive monthly intelligence brief.📊 Current State
scripts/news-types/monthly-review.ts(335 lines)search_dokument,get_dokument_innehall,search_anforanden,get_betankanden,get_propositioner,get_motioner)🚀 Desired State
🔧 Implementation Approach
1. Multi-month trend aggregation (~80 lines)
2. Party performance rankings (~70 lines)
3. Legislative efficiency metrics (~60 lines)
4. "Month in Numbers" section (~40 lines)
5. Enhanced article templates
🤖 Recommended Agent
code-quality-engineer— TypeScript enhancement with data aggregation patterns✅ Acceptance Criteria
📚 References
scripts/news-types/monthly-review.tsscripts/news-types/weekly-review.ts(base enrichment pipeline)scripts/data-transformers/risk-analysis.tsscripts/data-transformers/policy-analysis.tsscripts/data-transformers/document-analysis.ts</issue_description>
<agent_instructions>Extend monthly-review articles in scripts/news-types/monthly-review.ts with multi-month trend analysis, party performance rankings, and legislative efficiency metrics. Add "Month in Numbers" and "Party Performance Rankings" template sections. Leverage data-transformers for analysis. Run tests with npx vitest run.</agent_instructions>
Comments on the Issue (you are @copilot in this ...
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.