Skip to content

AI-driven policy mindmap generation with 5-dimension political model and cross-branch connections#1167

Merged
pethers merged 45 commits intomainfrom
copilot/enhance-ai-driven-mindmap-generator
Mar 16, 2026
Merged

AI-driven policy mindmap generation with 5-dimension political model and cross-branch connections#1167
pethers merged 45 commits intomainfrom
copilot/enhance-ai-driven-mindmap-generator

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 13, 2026

  • Review latest actionable PR thread (3955426987)
  • Inspect current code and test assertions in tests/agentic-workflow-mcp-queries.test.ts
  • Investigate recent CI failures via GitHub Actions logs
    • list_workflow_runs used for branch history
    • Retrieved failed job logs (Quality Checks -> typescript-lint) for recent failed runs
  • Apply requested test cleanups:
    • Replace brittle cross-reference fallback with case-insensitive regex covering cross-reference / cross-referencing variants
    • Remove duplicated date-calculation assertions for clearer failure signals
    • Consolidate overlapping filtering guidance assertions to reduce redundancy
  • Run targeted validation
    • npx tsc -p tsconfig.scripts.json --noEmit
    • npx vitest run tests/agentic-workflow-mcp-queries.test.ts (53/53 passed)
  • Run final automated checks
    • code_review (no comments)
    • codeql_checker (0 alerts)
  • Screenshot captured for PR/update context: https://github.com/user-attachments/assets/1b441776-0ad6-423d-bea3-a4c178ea80be
  • Reply on PR thread with commit hash and summary
Original prompt

This section details on the original issue you should resolve

<issue_title>AI-Driven Policy Mindmap Generation with Multi-Iteration Refinement</issue_title>
<issue_description>## 📋 Issue Type
Feature / Enhancement

🎯 Objective

Enhance the policy mindmap generator (scripts/data-transformers/content-generators/mindmap-section.ts) to produce AI-driven conceptual maps that reveal deep policy connections, actor networks, legislative dependencies, and impact chains — rather than simple static branch structures built from document type counts. The current mindmap creates branches from document categories and stakeholder lists. This must be redesigned so the AI agent analyzes document content to discover non-obvious policy relationships, cross-committee dependencies, and multi-stakeholder impact pathways through multiple analysis iterations.

📊 Current State

  • mindmap-section.ts (194 lines): Generates pure-CSS mindmap with central topic node and color-coded branches — good rendering, poor analytical depth
  • Static branch construction: In generators.ts lines 1280-1341, branches are built from document type counts and fixed stakeholder names:
    • Document type branch: just lists "Propositions (3)", "Committee Reports (5)"
    • Policy domain branch: from detectPolicyDomains() (keyword-based, not AI-analyzed)
    • Stakeholder branch: fixed 3 names (Government, Opposition, Private)
    • Data source branch: fixed list ("CIA Intelligence", "World Bank", "SCB")
  • No relationship analysis: Branches are independent lists — no connections showing how policies affect stakeholders or how committees relate
  • Keyword-based domain detection: detectPolicyDomains() uses pattern matching, not semantic understanding
  • Summary text is generic: "Conceptual map for deep inspection: ${topic}" — not AI-generated insight

🚀 Desired State

  • AI-generated mindmap branches that reveal:
    1. Policy Impact Chains: How a proposition flows through committees → floor votes → implementation → affected stakeholders
    2. Cross-Committee Dependencies: Policies that span multiple committee jurisdictions
    3. Stakeholder Conflict/Alignment Map: Which stakeholders benefit/lose from each policy strand
    4. Legislative Timeline Branches: Upcoming decisions, deadlines, and milestones
    5. EU/International Context: How domestic proposals connect to EU directives and international obligations
    6. Historical Precedent: Similar past legislation and its outcomes
    7. Risk Nodes: Identified risks and blockers in the legislative pipeline
  • Dynamic branch generation: AI determines branch structure based on content analysis (not fixed categories)
  • Multi-iteration refinement: First pass creates initial structure, second pass discovers hidden connections, third pass validates against source documents
  • Relationship indicators: Visual connections between branches showing dependencies (CSS-only)
  • AI-generated summary: Analytical paragraph explaining the mindmap's key insight (not generic template)
  • Depth levels: Support 3+ levels of nesting (current: 2 levels — branch → leaf items)

🔧 Implementation Approach

Step 1: Create AI Mindmap Analyzer

// New: scripts/ai-analysis/mindmap-analyzer.ts
interface MindmapAnalysisResult {
  topic: string;
  summary: string;  // AI-generated analytical summary
  branches: AIEnrichedBranch[];
  connections: BranchConnection[];  // cross-branch relationships
}

interface AIEnrichedBranch extends MindmapBranch {
  subBranches?: AIEnrichedBranch[];  // 3+ level nesting
  evidenceRefs?: string[];           // document IDs
  importance: 'critical' | 'high' | 'medium' | 'low';
  connections?: string[];            // IDs of related branches
}

interface BranchConnection {
  from: string;
  to: string;
  type: 'dependency' | 'conflict' | 'alignment' | 'sequence';
  label?: string;
}

Step 2: Enhance Mindmap CSS for Deeper Nesting

  • Add CSS for 3-level nested branches (branch → sub-branch → leaf items)
  • Add visual connection lines between related branches (CSS pseudo-elements)
  • Add importance indicators (border width/style based on importance level)
  • Maintain responsiveness at all breakpoints

Step 3: Integrate with Analysis Pipeline

  • Replace static branch construction in generators.ts with AI mindmap analysis
  • Pass enriched document content (fullText, not just titles) to analyzer
  • AI determines optimal number of branches (4-8) based on topic complexity
  • Generate language-specific branch labels and summaries

Step 4: Multi-Iteration Refinement

  • Iteration 1: Initial topic decomposition into branches
  • Iteration 2: Discovery of cross-branch connections and hidden relationships
  • Iteration 3: Validation against source documents and completeness check

🤖 Recommended Agent

code-quality-engineer — Requires enhancing mindmap-section.ts rendering, creating AI analysis integration...


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agentic-workflow Agentic workflow changes ci-cd CI/CD pipeline changes dependencies Dependency updates deployment Deployment configuration documentation Documentation updates html-css HTML/CSS changes javascript JavaScript code changes news News articles and content generation refactor Code refactoring size-l Large change (250-1000 lines) size-s Small change (10-50 lines) size-xl Extra large change (> 1000 lines) testing Test coverage translation Translation updates workflow GitHub Actions workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AI-Driven Policy Mindmap Generation with Multi-Iteration Refinement

4 participants