Skip to content

feat: Enhance week-ahead cross-referencing with policy context, questions, and interpellation spotlight#609

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/enhance-cross-referencing-tools
Draft

feat: Enhance week-ahead cross-referencing with policy context, questions, and interpellation spotlight#609
Copilot wants to merge 2 commits intomainfrom
copilot/enhance-cross-referencing-tools

Conversation

Copy link
Contributor

Copilot AI commented Feb 26, 2026

Week-ahead articles collected data from all 5 MCP tools but displayed them as disconnected lists — calendar events had no policy context, questions weren't linked to debates, and interpellations lacked minister attribution.

Changes

scripts/data-transformers/content-generators.ts

  • extractKeywords(text) — shared helper (min 2 chars, captures 'EU', 'KU', 'AI' acronyms); replaces duplicate inline filter logic
  • findRelatedDocuments(event, docs) — matches by organ equality first, then keyword overlap; max 3 results per event
  • findRelatedQuestions(event, questions) — keyword-overlap match against question titles; max 3 results per event
  • extractMinister(summary) — extracts targeted minister from till MINISTER header line in interpellation summaries
  • Per-event Policy Context box — rendered inside the high-priority events loop when related docs/questions are found:
    <div class="policy-context-box">
      <h4>Policy Context</h4>
      <div class="document-entry">…related proposition…</div>
      <div class="document-entry">…linked question…</div>
    </div>
  • "Questions to Watch" — replaces "Parliamentary Questions to Ministers"; updated labels in all 14 languages
  • "Interpellation Spotlight" — replaces "Interpellations Pending"; updated labels in all 14 languages; adds <p class="minister-target">→ [Minister]</p> per interpellation

scripts/news-types/week-ahead.ts

  • Removed TODO comment; replaced with implementation note documenting all 5 active MCP tools

tests/news-types/week-ahead.test.ts

  • 6 new tests in describe('Enhanced Cross-Referencing'): policy-context box rendering, EN/SV section labels for both new sections, minister name extraction
Original prompt

This section details on the original issue you should resolve

<issue_title>Improve Week Ahead: Enhance cross-referencing with policy documents, questions, and interpellations</issue_title>
<issue_description>## 📋 Issue Type
Enhancement — Extend Week Ahead articles with document context, written questions, and interpellations

🎯 Objective

Implement the TODO additional MCP tools in scripts/news-types/week-ahead.ts to provide richer forward-looking parliamentary previews: search_dokument (related policy documents), get_fragor (written questions for upcoming debates), and get_interpellationer (interpellations scheduled for the week).

📊 Current State

  • File: scripts/news-types/week-ahead.ts (488 lines)
  • Implemented tools: get_calendar_events ✅, search_dokument ✅, search_anforanden ✅, get_fragor ✅, get_interpellationer
  • REQUIRED_TOOLS: 5 tools all declared
  • Gap: While tools are listed in REQUIRED_TOOLS, the TODO at line 50 indicates the analysis depth is shallow — calendar events drive the article but related policy documents, questions, and interpellations aren't deeply cross-referenced with calendar items
  • Impact: Week ahead articles list what's happening but miss the policy context (why it matters, what questions are pending, which interpellations will be debated)

🚀 Desired State

  • Calendar events are enriched with related policy document context
  • Written questions (get_fragor) are linked to specific upcoming debates
  • Interpellations are highlighted with their urgency and minister responses
  • Articles provide "why this matters" context for each major calendar item
  • Cross-referencing between calendar events and pending parliamentary questions
  • Enhanced prospective analysis connecting upcoming events to ongoing policy threads

🔧 Implementation Approach

1. Deep document cross-referencing (~80 lines)

For each calendar event, search for related documents:

// For each calendar event, find related policy context
const relatedDocs = await mcpClient.call('search_dokument', {
  titel: calendarEvent.summary,
  from_date: weekStartDate,
  to_date: weekEndDate,
  limit: 3
});
  • Connect committee meetings to their pending betänkanden
  • Link plenary sessions to propositions being debated

2. Question-debate linkage (~60 lines)

Match written questions to upcoming committee/plenary sessions:

  • Identify which ministers will face questions
  • Highlight overdue responses
  • Flag questions connected to upcoming votes

3. Interpellation enrichment (~60 lines)

  • Link interpellations to specific debate slots
  • Add minister response status
  • Highlight high-profile confrontations

4. Enhanced article templates

  • Add "Policy Context" subsection per day
  • Add "Questions to Watch" sidebar content
  • Add "Interpellation Spotlight" for major confrontations
  • Update all 14 language templates

🤖 Recommended Agent

code-quality-engineer — TypeScript enhancement with MCP tool orchestration patterns

✅ Acceptance Criteria

  • Calendar events cross-referenced with related policy documents
  • Written questions linked to upcoming debate topics
  • Interpellations enriched with minister response context
  • Article templates include new "Policy Context" sections
  • All 14 language templates updated
  • Prospective tone maintained (forward-looking, not retrospective)
  • Article quality validation passes with enhanced content
  • No regression in existing week-ahead generation
  • Performance within 15-second batch target for all languages

📚 References

  • File: scripts/news-types/week-ahead.ts:50-53 (TODO comments)
  • MCP Tools: search_dokument, get_fragor, get_interpellationer
  • Content generators: scripts/data-transformers/content-generators.ts
  • Calendar transformer: scripts/data-transformers/calendar.ts
    </issue_description>

<agent_instructions>Enhance week-ahead article cross-referencing in scripts/news-types/week-ahead.ts. Deepen integration of search_dokument, get_fragor, and get_interpellationer to cross-reference calendar events with policy context. Add "Policy Context" and "Questions to Watch" template sections. Update all 14 language templates. Run tests with npx vitest run.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…ions to watch, and interpellation spotlight

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Copilot AI changed the title [WIP] Enhance Week Ahead with additional MCP tools feat: Enhance week-ahead cross-referencing with policy context, questions, and interpellation spotlight Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Week Ahead: Enhance cross-referencing with policy documents, questions, and interpellations

2 participants