C4 Model Architecture for European Parliament Intelligence Platform
๐ System Context โข ๐ฆ Container View โข ๐ง Component Design
๐ Document Owner: CEO | ๐ Version: 1.2 | ๐
Last Updated:
2026-04-20 (UTC) | ๐ฆ Release: v0.8.40
๐ Review Cycle: Quarterly | โฐ Next Review: 2026-07-20
โ April-2026 Aggregator-Pipeline Migration โ Complete
The April-2026 release migrated from an AI-authored-HTML pipeline to a deterministic aggregator pipeline. Article HTML is now rendered by
src/aggregator/**from committed Stage-B analysis artifacts โ there is no AI-authored HTML step, no per-article-type strategies, no AI_MARKER/FALLBACK_TEMPLATE sentinel contract, and nosrc/utils/content-validator.ts/validate-articles.ts/validate-analysis-completeness.tsruntime validators.Canonical references for the current release:
- ๐ข Render entry point:
src/aggregator/article-generator.ts(CLI:npm run generate-article -- --run <analysis-run-dir>)- ๐ฆ Aggregator modules:
artifact-order.ts,clean-artifact.ts,analysis-aggregator.ts,markdown-renderer.ts,article-html.ts,article-metadata.ts(5-tier editorial-highlight resolver for<title>/<meta description>โ manifest override โ first artefact H1 โ aggregated H1 โ first strong prose โ localized template)- ๐ค Agentic workflows: 8 unified
news-<type>.mdfiles (Stages A โ B โ C โ D โ E in one session) +news-translate.md; the split-family workflows (news-<type>-analysis.md+news-<type>-article.md) and the manualnews-article-generator.mdhelper were deleted- ๐ฐ Economic-context enforcement: editorial Stage-C agent-side review over
intelligence/economic-context.md(the Wave-2 OR-gate and Wave-3/Wave-4 strict runtime gates insrc/utils/content-validator.tswere purged with the rest of the validator layer; enforcement moved to the Stage-C completeness review protocol in.github/prompts/03-analysis-completeness-gate.mdand the depth floors inanalysis/methodologies/reference-quality-thresholds.json)The C4 Container and Component diagrams in this document have been rewritten against the post-migration aggregator stack โ they no longer reference deleted strategies/builders/
content-validator.ts.
This document serves as the primary entry point for the EU Parliament Monitor's architectural documentation. It provides a comprehensive view of the system's design using the C4 model approach, starting from a high-level system context and drilling down to component interactions.
| Document | Focus | Description | Documentation Link |
|---|---|---|---|
| Architecture | ๐๏ธ Architecture | C4 model showing current system structure | View Source |
| Future Architecture | ๐๏ธ Architecture | C4 model showing future system structure | View Source |
| Mindmaps | ๐ง Concept | Current system component relationships | View Source |
| Future Mindmaps | ๐ง Concept | Future capability evolution | View Source |
| SWOT Analysis | ๐ผ Business | Current strategic assessment | View Source |
| Future SWOT Analysis | ๐ผ Business | Future strategic opportunities | View Source |
| Data Model | ๐ Data | Current data structures and relationships | View Source |
| Future Data Model | ๐ Data | Enhanced European Parliament data architecture | View Source |
| Flowcharts | ๐ Process | Current data processing workflows | View Source |
| Future Flowcharts | ๐ Process | Enhanced AI-driven workflows | View Source |
| State Diagrams | ๐ Behavior | Current system state transitions | View Source |
| Future State Diagrams | ๐ Behavior | Enhanced adaptive state transitions | View Source |
| Security Architecture | ๐ก๏ธ Security | Current security implementation | View Source |
| Future Security Architecture | ๐ก๏ธ Security | Security enhancement roadmap | View Source |
| Threat Model | ๐ฏ Security | STRIDE threat analysis | View Source |
| Classification | ๐ท๏ธ Governance | CIA classification & BCP | View Source |
| CRA Assessment | ๐ก๏ธ Compliance | Cyber Resilience Act | View Source |
| Workflows | โ๏ธ DevOps | CI/CD documentation | View Source |
| Future Workflows | ๐ DevOps | Planned CI/CD enhancements | View Source |
| Business Continuity Plan | ๐ Resilience | Recovery planning | View Source |
| Financial Security Plan | ๐ฐ Financial | Cost & security analysis | View Source |
| End-of-Life Strategy | ๐ฆ Lifecycle | Technology EOL planning | View Source |
| Unit Test Plan | ๐งช Testing | Unit testing strategy | View Source |
| E2E Test Plan | ๐ Testing | End-to-end testing | View Source |
| Performance Testing | โก Performance | Performance benchmarks | View Source |
| Security Policy | ๐ Security | Vulnerability reporting & security policy | View Source |
EU Parliament Monitor is developed and maintained in accordance with Hack23 AB's Information Security Management System (ISMS), which is aligned with ISO 27001:2022, NIST CSF 2.0, and CIS Controls v8.1.
| Policy | Description | Relevance to EU Parliament Monitor |
|---|---|---|
| Information Security Policy | Establishes organization-wide security governance and risk management framework | Defines overall security posture, risk assessment methodology, and management responsibilities for the project |
| Secure Development Policy | Defines secure coding standards, code review requirements, and SDLC security gates | Mandates security-first development practices: input validation, dependency scanning, SAST/DAST integration, secure CI/CD pipelines |
| Open Source Policy | Governs use, contribution, and licensing of open source software | Ensures compliance with Apache-2.0 License, dependency license compatibility, and transparent open source contribution practices |
| Classification Policy | Defines data classification scheme (Public, Internal, Confidential, Restricted) and handling requirements | All project content classified as PUBLIC; establishes data handling controls for any future sensitive data integration |
| AI Policy | Governs responsible AI usage, transparency, and human oversight requirements | Governs LLM usage for content generation: transparency requirements, human review workflows, bias mitigation, prompt injection protection |
| Access Control Policy | Defines authentication, authorization, least privilege, and privileged access management | Controls GitHub repository access, branch protection rules, secret management, and deployment permissions |
| Cryptography Policy | Establishes cryptographic standards for data protection (algorithms, key management, TLS) | Mandates HTTPS-only content delivery, TLS 1.2+ (TLS 1.3 where supported) for outbound HTTPS API communications; EP MCP integration uses a local stdio JSON-RPC channel (no TLS); ensures secure secret storage for LLM API keys |
ISO 27001:2022 Controls Implemented:
NIST CSF 2.0 Functions Addressed:
CIS Controls v8.1 Implemented:
Evidence of ISMS compliance is maintained through:
EU Parliament Monitor is a TypeScript-first static site generator and political intelligence platform that creates multi-language news articles about European Parliament activities. Content is produced by a fleet of 9 agentic GitHub Workflows (gh-aw โ 8 unified news-<type>.md + news-translate.md) that drive AI agents (Claude Opus 4.7 via GitHub Copilot) through the Stage AโE protocol, consuming structured data from three data surfaces:
v1.2.15+ (primary โ 60+ tools including plenary, MEPs, votes, committees, procedures, adopted texts, sliding-window + fixed-window feeds, analytical tools, and a three-state voting fallback to the EP Open Data Portal)TypeScript code handles data acquisition, analysis orchestration, HTML structure, and validation; AI agents author all narrative content under a strict two-pass AI-First Quality regime.
Enable democratic transparency by providing automated, multilingual coverage of European Parliament activities through a secure, maintainable static site architecture.
european-parliament-mcp-server@1.2.15) plus one optional dependency (worldbank-mcp@1.0.1) used only at build time; markdown-it + plugins (markdown-it-anchor, markdown-it-footnote, markdown-it-attrs, markdown-it-deflist) vendored in the aggregator for deterministic artifact renderingsrc/ written in TypeScript 6.0.3 (strict, ESM, "type": "module"), compiled via tsc โ rootDir: ./src, outDir: ./scripts, target: ES2025, module: NodeNexten, sv, da, no, fi, de, fr, es, nl, ar, he, ja, ko, zh), defined in src/constants/language-core.ts::ALL_LANGUAGESbreaking, committee-reports, month-ahead, month-in-review, motions, propositions, week-ahead, week-in-review) โ each type is a slug, not a strategy module; the aggregator renders the same canonical artifact order for every type and per-type content differences are carried by the Stage-B artifacts themselvesnews-<type>.md article types (Stages A โ B โ C โ D โ E in one session, active-work budget 22โ27 min before the single safe-outputs create_pull_request call, 75-min hard timeout) + news-translate.md (14-language flush translation, exempt from the single-PR rule) โ compiled to .lock.yml via gh aw compile --validate (pinned GH_AW_VERSION: v0.69.0)analysis/daily/<date>/<slug>-run<NN>/ and commit it. The deterministic aggregator (src/aggregator/**, invoked via npm run generate-article -- --run <analysis-run-dir> for a single run or npm run generate-article:all for batch regen) walks manifest.json, cleans each artifact, and emits the final HTML with the shared site chrome (stacked header + embedded 14-language switcher + TOC sidebar + footer stats) and 14-language hreflang entries. There is no AI-authored HTML step, no strategies, no builders, no section-buildersintelligence/economic-context.md; World Bank MCP provides complementary non-economic context only. Enforcement is editorial at the Stage-C completeness review โ the legacy runtime gates (articlePolicyHasEconomicContext, articlePolicyHasIMFEconomicEvidence, isWave3IMFStrictEnabled) in src/utils/content-validator.ts were purged in April-2026; the Stage-C reviewer applies the IMF-required-for-policy rule directly over the committed artifact[AI_ANALYSIS_REQUIRED] sentinel markers in any committed file (enforced at Stage-C agent-side review against reference-quality-thresholds.json)awmg gateway at http://host.docker.internal:8080/mcp/european-parliamentdeploy-s3.yml with OIDC auth); GitHub Pages retained as documented fallback; npm package published to registry.npmjs.org/euparliamentmonitor with SLSA Level 3 provenance๐ค User Focus: Shows how different user types interact with the EU Parliament Monitor system and what external systems it depends on.
๐ Integration Focus: Illustrates the relationships with GitHub infrastructure, European Parliament APIs, and LLM services.
C4Context
title EU Parliament Monitor - System Context Diagram
Person(citizen, "European Citizen", "Reads news about European Parliament activities in their native language")
Person(journalist, "Journalist", "Uses site as research source for European political coverage")
Person(researcher, "Political Researcher", "Analyzes EP activities and trends")
Person(contributor, "Developer/Contributor", "Maintains and improves the news generation system")
System(epmonitor, "EU Parliament Monitor", "Static site with multilingual news about European Parliament activities")
System_Ext(github, "GitHub", "Hosts repository, runs CI/CD (GitHub Actions)")
System_Ext(aws, "AWS (S3 + CloudFront)", "Serves static site globally via CDN")
System_Ext(ep_mcp, "European Parliament MCP Server", "Provides structured access to EP data")
System_Ext(ep_api, "European Parliament APIs", "Official EP data sources (plenary, committees, documents)")
System_Ext(llm, "LLM Service", "Generates article content from structured EP data")
Rel(citizen, epmonitor, "Reads news", "HTTPS")
Rel(journalist, epmonitor, "Researches stories", "HTTPS")
Rel(researcher, epmonitor, "Analyzes data", "HTTPS")
Rel(contributor, github, "Contributes code", "Git/HTTPS")
Rel(epmonitor, github, "Built and deployed via", "GitHub Actions")
Rel(epmonitor, aws, "Hosted on", "S3 + CloudFront")
Rel(github, epmonitor, "Generates site via", "GitHub Actions")
Rel(epmonitor, ep_mcp, "Fetches EP data via", "MCP Protocol")
Rel(ep_mcp, ep_api, "Queries EP data", "HTTPS/JSON")
Rel(epmonitor, llm, "Generates content via", "API/SDK")
UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="2")
| Element | Type | Description | Technology |
|---|---|---|---|
| European Citizen | User | Primary audience seeking EP news in native language | Web Browser |
| Journalist | User | Professional using site for research and story development | Web Browser |
| Political Researcher | User | Academic or analyst studying EP activities | Web Browser |
| Developer/Contributor | User | Maintainer improving system | Git, Node.js, VS Code |
| EU Parliament Monitor | System | Core static site generator | Node.js, TypeScript |
| GitHub | External System | Source control, CI/CD | GitHub Actions |
| EP MCP Server | External System | Structured EP data access | MCP Protocol, TypeScript |
| EP APIs | External System | Official data sources | REST APIs, JSON |
| LLM Service | External System | Content generation | API (OpenAI/Anthropic/etc.) |
graph TB
subgraph "Public Internet - Untrusted Zone"
Users["Web Users\nCitizens, Journalists, Researchers"]
end
subgraph "GitHub Infrastructure - Trusted Zone"
subgraph "Build Environment"
Actions["GitHub Actions Runner\nGitHub-hosted Ubuntu runner\nubuntu-latest + Node.js 25"]
EPServer["European Parliament\nMCP Server\nLocal process, stdio JSON-RPC"]
end
subgraph "Source Control"
Repo["Git Repository\nVersion Control"]
end
end
subgraph "AWS Hosting - Cloud Infrastructure Zone"
Pages["AWS S3 + CloudFront CDN\nHTTPS via ACM"]
end
subgraph "External Services - Partially Trusted Zone"
EPAPI["European Parliament\nOfficial APIs"]
LLM["LLM Service\nOpenAI/Anthropic"]
end
Users -->|"HTTPS GET\nRead-Only"| Pages
Actions -->|"Spawns locally\nstdio JSON-RPC"| EPServer
EPServer -->|"HTTPS/JSON\nData Queries"| EPAPI
Actions -->|"API Calls\nContent Gen"| LLM
Actions -->|"Git Push\nAuthenticated"| Repo
Actions -->|"S3 Sync + CF Invalidation\nAuthenticated via OIDC"| Pages
classDef users fill:#CE93D8,stroke:#6A1B9A,stroke-width:2px,color:#000000
classDef hosting fill:#A5D6A7,stroke:#2E7D32,stroke-width:2px,color:#000000
classDef actions fill:#90CAF9,stroke:#1565C0,stroke-width:2px,color:#000000
classDef external fill:#FFE082,stroke:#F57C00,stroke-width:2px,color:#000000
class Users users
class Pages hosting
class Actions actions
class EPServer,EPAPI,LLM external
Trust Boundary Analysis:
| Zone | Trust Level | Security Controls | Threat Model |
|---|---|---|---|
| Public Internet | Untrusted | HTTPS-only, planned CSP headers, static content only | DDoS, XSS attempts (mitigated by static architecture) |
| GitHub Infrastructure | Trusted | GitHub authentication, branch protection, optional signed commits, secret scanning | Supply chain attacks (mitigated by Dependabot, CodeQL) |
| AWS Hosting | Trusted | ACM certificate, HTTPS redirect, DDoS protection via CloudFront | Hosting infrastructure compromise (mitigated by AWS security controls, OIDC deploy auth) |
| External Services | Partially Trusted | API authentication, basic input parsing/shape validation; planned systematic sanitization/escaping and rate limiting | Data poisoning, API compromise (mitigated by validation, monitoring, planned hardening) |
Key Security Boundaries:
๐ฆ Container Focus: Major containers (applications, data stores, MCP clients) of the post-April-2026 aggregator pipeline.
๐ Data Flow Focus: How agentic workflows produce analysis artifacts and how the deterministic aggregator renders them into 14-language HTML.
%%{init: {"theme":"dark","themeVariables":{"primaryColor":"#1565C0","primaryTextColor":"#fff","lineColor":"#90CAF9","fontFamily":"Inter, Helvetica, Arial, sans-serif"}}}%%
C4Container
title EU Parliament Monitor โ Container Diagram (April-2026 aggregator pipeline)
Person(user, "Reader", "Reads multilingual EP news at euparliamentmonitor.com")
Person(contributor, "Contributor", "Maintains code, methodologies, translations")
Person(researcher, "Researcher / Journalist", "Audits analysis artifacts via the Political Intelligence Hub")
Container_Boundary(epmonitor, "EU Parliament Monitor") {
Container(aw_orchestrator, "gh-aw Orchestrator", "Agentic Workflows (Claude Opus 4.7)", "9 agentic workflows: 8 unified news-<type>.md + news-translate.md")
Container(prompt_lib, "Prompt Library", "10 bounded contexts", ".github/prompts/00-scope โฆ 09-troubleshooting; lint:prompts drift-guard")
Container(methodology_lib, "Methodology Library", "Markdown methodologies + JSON thresholds", "17 methodologies + reference-quality-thresholds.json (analysis/methodologies/)")
Container(template_lib, "Template Library", "51 Markdown templates", "39 core + 12 extended (analysis/templates/)")
ContainerDb(analysis_runs, "Analysis Runs", "Markdown + JSON", "analysis/daily/YYYY-MM-DD/<type>/{manifest.json,intelligence/,classification/,risk-scoring/,threat-assessment/,documents/,extended/}")
Container(aggregator, "Aggregator (5 modules)", "TypeScript", "src/aggregator/**: artifact-order ยท clean-artifact ยท analysis-aggregator ยท markdown-renderer ยท article-html ยท article-metadata ยท article-generator (CLI)")
Container(ep_client, "EP MCP Client", "TypeScript", "Stdio JSON-RPC to european-parliament-mcp-server@1.2.15+; 60+ tools; getVotingRecordsWithFallback() to EP Open Data Portal (src/mcp/ep-mcp-client.ts)")
Container(wb_client, "World Bank MCP Client", "TypeScript", "WORLD_BANK_MCP_TOOLS โ non-economic indicators only (src/mcp/wb-mcp-client.ts)")
Container(imf_client, "IMF REST Client", "TypeScript", "IMF_MCP_TOOLS โ primary economic source: WEO/Fiscal Monitor/IFS/BOP/ER/PCPS (src/mcp/imf-mcp-client.ts)")
Container(stage_c_review, "Stage-C Review", "Editorial agent + thresholds", "Reads .github/prompts/03-analysis-completeness-gate.md + reference-quality-thresholds.json โ replaces purged content-validator.ts")
Container(news_indexes, "News Indexes & Sitemap", "TypeScript", "Per-language index pages + sitemap.xml + sitemap_<lang>.html (src/generators/news-indexes.ts, sitemap.ts)")
ContainerDb(static_files, "Static Site Output", "HTML/CSS/JS/JSON", "news/<slug>-<lang>.html (14 langs) ยท news/<slug>.en.md ยท article.md per run ยท sitemap.xml ยท articles-metadata.json")
}
Container_Boundary(github_infra, "GitHub Infrastructure") {
Container(actions, "GitHub Actions", "CI/CD + gh-aw runtime", "9 news + ~15 standard workflows; SHA-pinned actions; OpenSSF Scorecard")
ContainerDb(repo, "Git Repository", "Version control", "Source + analysis runs + generated content; SLSA L3 provenance")
}
Container_Boundary(aws_infra, "AWS Infrastructure") {
Container(cf_s3, "CloudFront + S3", "CDN / object storage", "Primary hosting ยท ACM HTTPS ยท OIDC GithubWorkFlowRole ยท cache: HTML 1h, immutable assets 1y")
}
System_Ext(ep_mcp, "European Parliament MCP Server v1.2.15+", "60+ tools โ plenary, voting, motions, committee, MEPs, declarations, procedures, analytical (voting-anomaly, coalition, MEP-influence)")
System_Ext(ep_open_data, "EP Open Data Portal", "https://data.europarl.europa.eu โ voting-records fallback (/api/v2/decision)")
System_Ext(wb_mcp, "World Bank Open Data MCP", "Non-economic WDI indicators (health, education, environment, governance)")
System_Ext(imf_api, "IMF SDMX 3.0 REST", "https://dataservices.imf.org/REST/SDMX_3.0/")
System_Ext(copilot, "GitHub Copilot / Claude Opus 4.7", "Authors analysis Markdown under 2-pass AI-First Quality regime โ never authors HTML")
Rel(user, cf_s3, "Reads HTML in 14 langs", "HTTPS")
Rel(researcher, repo, "Audits analysis/daily/", "Git/HTTPS")
Rel(contributor, repo, "Commits code + methodologies", "Git/HTTPS")
Rel(actions, aw_orchestrator, "Triggers on schedule / manual", "gh-aw engine")
Rel(aw_orchestrator, copilot, "Delegates analysis authoring", "Copilot CLI")
Rel(aw_orchestrator, prompt_lib, "Imports prompts", "Markdown")
Rel(aw_orchestrator, methodology_lib, "Reads methodologies", "Markdown")
Rel(aw_orchestrator, template_lib, "Fills templates", "Markdown")
Rel(aw_orchestrator, ep_client, "Stage A โ fetch", "fn")
Rel(aw_orchestrator, wb_client, "Stage A โ context (optional)", "fn")
Rel(aw_orchestrator, imf_client, "Stage A โ economic context", "fn")
Rel(aw_orchestrator, analysis_runs, "Stage B โ write artifacts", "fs.write")
Rel(aw_orchestrator, stage_c_review, "Stage C โ completeness gate", "agent review")
Rel(stage_c_review, analysis_runs, "Reads + grades", "fn")
Rel(aw_orchestrator, aggregator, "Stage D โ npm run generate-article", "CLI")
Rel(aggregator, analysis_runs, "Reads manifest.json + artifacts", "fs.read")
Rel(aggregator, static_files, "Writes 14 HTML + Markdown", "fs.write")
Rel(news_indexes, static_files, "Writes index pages", "fs.write")
Rel(ep_client, ep_mcp, "stdio JSON-RPC", "MCP")
Rel(ep_client, ep_open_data, "Voting fallback", "HTTPS REST")
Rel(wb_client, wb_mcp, "stdio JSON-RPC", "MCP")
Rel(imf_client, imf_api, "HTTPS / SDMX", "REST")
Rel(static_files, repo, "Stage E โ single PR", "Git")
Rel(actions, cf_s3, "Deploy via OIDC", "S3 sync + CloudFront invalidation")
UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="2")
| ๐งฑ Container | โ๏ธ Technology | ๐ฏ Purpose | ๐ Data flow |
|---|---|---|---|
| ๐ค gh-aw Orchestrator | Claude Opus 4.7 + gh-aw v0.69.0+ | Runs 9 agentic workflows; produces analysis artifacts | Triggers via cron / manual; commits one PR per run |
| ๐ Prompt / Methodology / Template libraries | Markdown + JSON | Bounded-context prompts (10), methodologies (17), templates (51) | Read by every agentic workflow at start-of-session |
| ๐ง Analysis Runs | Markdown + JSON | Per-run intelligence tree under analysis/daily/<date>/<type>/ |
Written by Stage B agents; consumed by Stage C and aggregator |
| ๐ข Aggregator (5 modules) | TypeScript | Reads manifest.json and Markdown artifacts; renders 14-language HTML deterministically |
npm run generate-article -- --run <dir> |
| ๐ EP MCP Client | TypeScript | 60+ EP tools + voting fallback to EP Open Data Portal /api/v2/decision |
Stage A data collection |
| ๐ฐ IMF / ๐ฑ World Bank Clients | TypeScript | Economic context (IMF) + non-economic indicators (WB) | Stage A wave-2 context |
| โ๏ธ Stage-C Review | Editorial agent + JSON thresholds | Per-artifact line floors + tradecraft signals (Admiralty / WEP / ICD-203) | Replaces the purged content-validator.ts runtime gate |
| ๐ News Indexes & Sitemap | TypeScript | 14-language index pages, sitemap.xml, hreflang alternates | npm run prebuild |
| ๐ฆ Static Site Output | HTML / CSS / JS / JSON / Markdown | Public deliverable: news pages + article.md source per run |
Committed to main, deployed to S3 |
| ๐ GitHub Actions | CI/CD + gh-aw | 9 news + ~15 standard workflows | Daily news + on-PR validation |
| โ๏ธ CloudFront + S3 | CDN / object storage | Primary hosting via OIDC GithubWorkFlowRole |
HTTPS + immutable asset cache |
| Container | Security responsibility | Implementation | Controls |
|---|---|---|---|
| ๐ค gh-aw Orchestrator | Sandboxed AWF runtime, Squid egress allowlist, capability-bounded safe outputs | Runs in GitHub-hosted ephemeral VMs; safe-outputs.create-pull-request.max: 1; step-security/harden-runner egress block |
A.5.10, A.8.28 (ISO 27001), CIS 16 |
| ๐ข Aggregator | Deterministic MarkdownโHTML; explicit markdown-it plugin allowlist; clean-artifact.ts strips SPDX/banners; script-src 'self' CSP |
No AI-authored HTML; vendored Mermaid/Chart.js/D3 under js/vendor/ |
A.8.23, A.8.28 (ISO 27001), OWASP A03 |
| ๐ EP MCP Client | Local stdio JSON-RPC; per-request timeout + retry backoff; envelope validation; voting-records three-state fallback | safeCallTool() + callToolWithRetry() wrappers in ep-mcp-client.ts |
A.8.24 (ISO 27001), CIS 16 |
| ๐ง Analysis Artifacts | Tradecraft grading (Admiralty A1โF6 + WEP) + provenance manifest | manifest.json cross-reference map; methodology-reflection.md audit |
A.5.12 (ISO 27001) |
| ๐ฆ Static Files | Public-data only; integrity via Git + SLSA L3 attestation | All EP/IMF/WB content is public; SBOM, REUSE licence headers | A.5.10 (ISO 27001) |
| ๐ GitHub Actions | OIDC for AWS deploy; Secrets at job-scope; SHA-pinned third-party actions | GithubWorkFlowRole IAM with least privilege; harden-runner egress allowlist |
A.8.3, CIS 6 |
| โ๏ธ CloudFront + S3 | HTTPS-only via ACM; bucket policy denies public ACLs; CloudFront cache-control by file class | Long-cache immutable assets, short-cache HTML | A.13.1, A.5.23 (ISO 27001) |
| Amazon CloudFront + S3 | HTTPS-only, CDN security, DDoS protection | Forces HTTPS redirect via ACM certificate, CloudFront with DDoS mitigation, HSTS headers (configured externally in CloudFront distribution) | A.8.24 (ISO 27001) |
| Git Repository | Access control, branch protection, signed commits | RBAC with least privilege, protected main branch, optional signed commits | CIS Control 6, A.8.3 |
graph TB
subgraph "Generation Layer - Build Time Security"
NewsGen["News Generator\nInput Validation\nData Sanitization"]
MCPClient["MCP Client\nLocal stdio JSON-RPC\nConnection Retry\nRequest Timeout"]
Template["Template Engine\nXSS Prevention\nCSP Generation\nHTML Sanitization"]
end
subgraph "Storage Layer - Version Control Security"
GitRepo["Git Repository\nBranch Protection\nCode Review\nAudit Logs"]
Secrets["GitHub Secrets\nEncrypted Storage\nLeast Privilege"]
end
subgraph "Delivery Layer - Runtime Security"
Pages["Amazon CloudFront + S3\nHTTPS-Only\nHSTS Headers\nDDoS Protection"]
CDN["CloudFront Edge\nTLS Termination\nEdge Caching\nGeographic Distribution"]
end
subgraph "External Layer - Third-Party Security"
EPMCP["EP MCP Server\nMCP Protocol\nData Validation"]
LLM["LLM Service\nAPI Key Auth\nPrompt Injection Prevention"]
end
NewsGen -->|Validated Data| Template
NewsGen -->|"Spawns locally via stdio"| MCPClient
MCPClient -->|JSON-RPC| EPMCP
NewsGen -->|Secured API Calls| LLM
Template -->|Safe HTML| GitRepo
Secrets -->|Inject at Runtime| NewsGen
GitRepo -->|Deploy to S3| Pages
Pages -->|Cached Content| CDN
classDef generation fill:#90CAF9,stroke:#1565C0,stroke-width:2px,color:#000000
classDef storage fill:#A5D6A7,stroke:#2E7D32,stroke-width:2px,color:#000000
classDef delivery fill:#FFCC80,stroke:#F57C00,stroke-width:2px,color:#000000
classDef external fill:#CE93D8,stroke:#6A1B9A,stroke-width:2px,color:#000000
class NewsGen,Template,MCPClient generation
class GitRepo,Secrets storage
class Pages,CDN delivery
class EPMCP,LLM external
๐ง Component Focus: Internal components of the deterministic aggregator (src/aggregator/**) and supporting MCP / methodology modules.
๐ฏ Responsibility Focus: How analysis Markdown artifacts produced by the agentic workflows become 14-language HTML deliverables.
%%{init: {"theme":"dark","themeVariables":{"primaryColor":"#1565C0","primaryTextColor":"#fff","lineColor":"#90CAF9","fontFamily":"Inter, Helvetica, Arial, sans-serif"}}}%%
C4Component
title EU Parliament Monitor โ Aggregator Components (post-April-2026)
Container_Boundary(aggregator_c, "Aggregator (src/aggregator/)") {
Component(article_generator, "article-generator.ts", "TypeScript CLI", "Entry point: npm run generate-article -- --run <dir>; walks manifest.json")
Component(artifact_order, "artifact-order.ts", "TypeScript", "ARTIFACT_SECTIONS โ canonical 19-section order")
Component(clean_artifact, "clean-artifact.ts", "TypeScript", "Strips SPDX/banner/provenance front matter from each artifact before merge")
Component(analysis_aggregator, "analysis-aggregator.ts", "TypeScript", "aggregateAnalysisRun() โ filters manifestFiles to .md only excluding data/runs/pass1; emits Provenance & Audit block at END")
Component(markdown_renderer, "markdown-renderer.ts", "TypeScript", "markdown-it + plugins (anchor, footnote, attrs, deflist); explicit allowlist; renderMarkdown()")
Component(article_html, "article-html.ts", "TypeScript", "HTML5 wrapper: stacked header, language switcher, TOC sidebar, JSON-LD NewsArticle, isBasedOn provenance, hreflang alternates, footer")
Component(article_metadata, "article-metadata.ts", "TypeScript", "5-tier editorial-highlight resolver for <title>/<meta description>: manifest override โ first-artifact H1 โ aggregated H1 โ first strong prose โ localized template")
}
Container_Boundary(mcp_c, "MCP & Data Clients (src/mcp/)") {
Component(ep_client, "ep-mcp-client.ts", "TypeScript", "60+ tools; safeCallTool + callToolWithRetry; recess-mode detection; slow-feed warnings")
Component(ep_open_data, "ep-open-data-client.ts", "TypeScript", "EPOpenDataClient + getVotingRecordsWithFallback() three-state fallback")
Component(wb_client, "wb-mcp-client.ts", "TypeScript", "WORLD_BANK_MCP_TOOLS โ non-economic indicators")
Component(imf_client, "imf-mcp-client.ts", "TypeScript", "class IMFMCPClient + IMF_MCP_TOOLS; native fetch SDMX 3.0; primary economic source")
Component(mcp_health, "mcp-health.ts / mcp-retry.ts / mcp-connection.ts", "TypeScript", "Health probes, retry backoff, connection lifecycle")
}
Container_Boundary(intel_c, "Intelligence Utilities (src/utils/, src/generators/)") {
Component(political_classification, "political-classification.ts", "TypeScript", "7-dimension EP event classification")
Component(political_threat, "political-threat-assessment.ts", "TypeScript", "5-framework political threat (Landscape 6D + Attack Trees + Kill Chain + Diamond + ICO)")
Component(political_risk, "political-risk-assessment.ts", "TypeScript", "5ร5 Likelihood ร Impact scoring")
Component(significance, "significance-scoring.ts", "TypeScript", "Publication priority score per artifact")
Component(quality_scorer, "article-quality-scorer.ts", "TypeScript", "Editorial quality signals")
Component(news_indexes, "news-indexes.ts + sitemap.ts", "TypeScript", "14-language indexes + sitemap.xml + per-language sitemap_<lang>.html")
}
Container_Boundary(scripts_c, "Workflow Scripts (scripts/aggregator/)") {
Component(prior_run_diff, "prior-run-diff.js", "Node.js", "Re-run merge helper; carry-forward vs rewrite classification; ENABLE_PRIOR_RUN_MERGE flag")
Component(forward_statements, "forward-statements-registry.js", "Node.js", "Forward-looking-statement JSONL registry; week/month-ahead seeding")
Component(checkpoint, "checkpoint-analysis-to-memory.sh", "Bash", "Pre-audited helper; replaces inline expansion-heavy bash in workflows (shell-safety)")
}
System_Ext(ep_mcp, "EP MCP Server v1.2.15+", "60+ tools โ plenary, voting, motions, committee, MEPs, declarations, procedures, analytical")
System_Ext(ep_portal, "EP Open Data Portal", "/api/v2/decision โ voting fallback")
System_Ext(wb_mcp, "World Bank Open Data MCP", "Non-economic WDI")
System_Ext(imf_api, "IMF SDMX 3.0", "WEO / FM / IFS / BOP / ER / PCPS")
ContainerDb(analysis_dir, "analysis/daily/<date>/<type>/", "Markdown + JSON", "manifest.json + intelligence/ + classification/ + risk-scoring/ + threat-assessment/ + extended/")
ContainerDb(news_dir, "news/<slug>(-<lang>).{md,html}", "Markdown + HTML", "Per-language deliverables")
Rel(article_generator, analysis_dir, "reads manifest.json", "fs.readFileSync")
Rel(article_generator, artifact_order, "uses ARTIFACT_SECTIONS", "import")
Rel(article_generator, clean_artifact, "cleans each artifact", "fn")
Rel(article_generator, analysis_aggregator, "aggregateAnalysisRun()", "fn")
Rel(analysis_aggregator, markdown_renderer, "renderMarkdown()", "fn")
Rel(markdown_renderer, article_html, "wraps in HTML5 chrome", "fn")
Rel(article_html, article_metadata, "5-tier metadata resolver", "fn")
Rel(article_html, news_dir, "writes 14 HTML + 1 .md", "fs.writeFileSync")
Rel(news_indexes, news_dir, "writes index pages + sitemaps", "fs.writeFileSync")
Rel(ep_client, ep_mcp, "stdio JSON-RPC", "MCP")
Rel(ep_open_data, ep_portal, "voting fallback", "HTTPS")
Rel(wb_client, wb_mcp, "stdio JSON-RPC", "MCP")
Rel(imf_client, imf_api, "HTTPS/SDMX", "REST")
Rel(ep_client, mcp_health, "health + retry", "fn")
Rel(prior_run_diff, analysis_dir, "carry-forward plan", "JSON")
Rel(forward_statements, analysis_dir, "JSONL registry seeding", "fs")
UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="2")
| ๐งฉ Component | ๐ฏ Responsibility | ๐ Dependencies | ๐ File location |
|---|---|---|---|
| ๐ข Aggregator pipeline | Discover manifest.json โ clean artifacts โ aggregate (19-section canonical order, Provenance & Audit at end, .md only excluding data/runs/pass1/) โ render Markdown โ wrap HTML with TOC sidebar + shared chrome โ write <slug>.en.md + 14 <slug>-<lang>.html |
markdown-it + markdown-it-anchor/-footnote/-attrs/-deflist |
src/aggregator/{article-generator,analysis-aggregator,markdown-renderer,article-html,artifact-order,clean-artifact,article-metadata}.ts |
| ๐ง Analysis artifacts | 51 templates per run (39 core + 12 extended) under analysis/daily/<date>/<type>/ with manifest.json declaring articleType + files map. 3-variant manifest schema (articleType / articleTypes[] / legacy runType) handled by resolveArticleTypeFromManifest() |
17 methodologies (10-step protocol, Rules 1โ22) | analysis/methodologies/*.md, analysis/templates/**, analysis/daily/** |
| ๐ EP MCP Client | 60+ EP tools via stdio JSON-RPC; safeCallTool() + callToolWithRetry() wrappers; recess-mode detection ([1952,2100] year window); slow-feed warning downgrade for get_events_feed |
european-parliament-mcp-server@1.2.15+ (PR #405 normalises political-group codes) |
src/mcp/ep-mcp-client.ts |
| ๐ณ๏ธ EP Open Data fallback | Three-state voting fallback: (a) MCP has data โ use it ยท (b) MCP empty โ query /api/v2/decision ยท (c) both empty โ ๐ด unavailability marker via virtual tool name ep-get-voting-records |
EP Open Data Portal | src/mcp/ep-open-data-client.ts (see getVotingRecordsWithFallback()) |
| ๐ฐ IMF Client | class IMFMCPClient + IMF_MCP_TOOLS; primary economic source per IMF Indicator Mapping; native Node 25 fetch SDMX 3.0; env IMF_API_BASE_URL, IMF_API_TIMEOUT_MS |
None (REST) | src/mcp/imf-mcp-client.ts |
| ๐ฑ World Bank Client | WORLD_BANK_MCP_TOOLS; non-economic WDI indicators only (health, education, environment, governance, innovation) |
worldbank-mcp (optional) |
src/mcp/wb-mcp-client.ts |
| โ๏ธ Stage-C completeness gate | Editorial agent-side review against .github/prompts/03-analysis-completeness-gate.md and analysis/methodologies/reference-quality-thresholds.json line floors. Replaces the purged runtime content-validator.ts |
Methodology library + per-artifact thresholds | .github/prompts/03-โฆ, analysis/methodologies/reference-quality-thresholds.json |
| ๐ Prior-Run Diff | Re-run merge helper; classifies existing artifacts as at-floor (carry-forward) or below-floor (rewrite); ENABLE_PRIOR_RUN_MERGE=true env flag; emits priorRunDiff JSON consumed by Stage B |
โ | scripts/aggregator/prior-run-diff.js |
| ๐ Forward-statements registry | Canonical last-occurrence-per-id JSONL registry; week/month-ahead seeds data/forward-statements-open.json; Stage C enforces a "carried-forward forward statements" section when open items exist |
JSONL registry | scripts/aggregator/forward-statements-registry.js, analysis/forward-statements/ |
| ๐ก๏ธ Shell-safety helper | Pre-audited bash helper for checkpoint-to-memory; replaces expansion-heavy inline workflow bash that the sandbox shell-safety filter would block | Bash | scripts/checkpoint-analysis-to-memory.sh |
| ๐ง Intelligence utilities | political-classification (7D), political-threat-assessment (5-framework), political-risk-assessment (5ร5 LรI), significance-scoring, article-quality-scorer |
Types | src/utils/*.ts |
| ๐ News Indexes & Sitemap | Per-language news index pages, sitemap.xml, per-language sitemap_<lang>.html, hreflang alternates |
Metadata, file-utils | src/generators/news-indexes.ts, src/generators/sitemap.ts |
| ๐ข Constants | ALL_LANGUAGES (14), LANGUAGE_PRESETS (all, eu-core, nordic), article-type slugs, committee indicator map |
โ | src/constants/*.ts |
sequenceDiagram
autonumber
participant CLI as CLI Interface
participant Gen as Article Generator
participant MCP as MCP Client
participant EPMCP as EP MCP Server
participant Tmpl as HTML Template
participant Meta as Metadata Manager
participant FS as File System Writer
CLI->>Gen: generate(type, languages)
Gen->>MCP: fetchEPData(type)
MCP->>EPMCP: query(endpoint, params)
EPMCP-->>MCP: return EP data
MCP-->>Gen: return parsed EP data
loop For each language (sequential)
Gen->>Tmpl: renderHTML(epData, lang)
Note over Gen,Tmpl: Current: placeholder English content<br/>Future (ADR-004): native LLM generation per language
Tmpl-->>Gen: return HTML
Gen->>FS: writeFile(path, html)
Gen->>Meta: recordGeneration(article, lang)
end
Meta->>FS: writeMetadata(json)
Gen-->>CLI: generation complete
| Pattern | Components Involved | Purpose | Error Handling |
|---|---|---|---|
| Cache-Aside (Planned) | MCP Client โ LRU Cache โ EP MCP Server | Reduce API calls, improve performance | Planned: cache miss triggers fresh fetch; current: direct calls to EP MCP Server |
| MCP Connection Retry with Backoff (Current) | MCP Client โ EP MCP Server | Handle transient MCP connection failures | Connection attempts retried with backoff; individual MCP requests use a fixed timeout and are not retried |
| Validation Pipeline (Planned) | Content Validator โ Article Generator | Ensure content quality | Planned: failed validation triggers regeneration (max 2 attempts); current: single-pass generation without regeneration loop |
| Sequential Multi-Language | Article Generator โ HTML Template (per language) | Content generation per language | Current: failure in one language aborts remaining languages; Planned: per-language failures logged while other languages still generate; parallel generation planned (ADR-004) |
| Template Method | Article Generator โ HTML Template โ File System Writer | Consistent HTML generation | Template errors logged and propagated to prevent partial writes |
| Metadata Aggregation | Metadata Manager โ File System Writer | Track generation history | Current: metadata written synchronously via writeFileSync; failures throw and fail the run. Planned: non-blocking, best-effort writes |
โ๏ธ Infrastructure Focus: Shows how the system is deployed on GitHub infrastructure.
๐ CI/CD Focus: Illustrates the automated deployment pipeline.
C4Deployment
title EU Parliament Monitor - Deployment Diagram
Deployment_Node(github_cloud, "GitHub Cloud", "GitHub Infrastructure") {
Deployment_Node(actions_runner, "GitHub Actions Runner", "Ubuntu 24.04") {
Container(workflow, "News Generation Workflow", "GitHub Actions YAML", "Daily scheduled workflow")
Container(node_runtime, "Node.js Runtime", "Node.js 25", "Executes generation scripts")
}
Deployment_Node(pages_cdn, "AWS Infrastructure", "S3 + CloudFront") {
Container(web_server, "Amazon CloudFront", "CDN / HTTPS", "Serves HTTPS content globally")
ContainerDb(static_content, "Amazon S3 Bucket", "Object Storage", "Generated articles and pages")
}
Deployment_Node(repo_storage, "GitHub Repository", "Git Storage") {
ContainerDb(git_repo, "Git Repository", "Version Control", "Source code and generated content")
}
}
Deployment_Node(user_device, "User Device", "Desktop/Mobile") {
Container(browser, "Web Browser", "Chrome/Firefox/Safari", "Renders news articles")
}
Deployment_Node(external_services, "External Services", "Cloud") {
System_Ext(ep_mcp, "EP MCP Server", "EP data access")
System_Ext(llm, "LLM Service", "Content generation")
}
Rel(workflow, node_runtime, "Executes", "Process")
Rel(node_runtime, ep_mcp, "Fetches data", "stdio/JSON-RPC")
Rel(node_runtime, llm, "Generates content", "HTTPS/API")
Rel(node_runtime, git_repo, "Commits files", "Git")
Rel(git_repo, static_content, "Deploys via", "S3 sync + CloudFront invalidation")
Rel(browser, web_server, "Requests pages", "HTTPS")
Rel(web_server, static_content, "Serves", "HTTP/2")
UpdateLayoutConfig($c4ShapeInRow="2", $c4BoundaryInRow="1")
| Infrastructure Component | Technology | Purpose | Configuration |
|---|---|---|---|
| GitHub Actions Runner | ubuntu-latest, Node.js 25 | Execute generation workflow | .github/workflows/news-*.lock.yml |
| Amazon CloudFront | AWS CDN | Serve static content globally | CloudFront distribution (deploy-s3.yml) |
| Amazon S3 | AWS Object Storage | Host static site files | S3 bucket (deploy-s3.yml) |
| Git Repository | GitHub Storage | Version control + content storage | public repository |
| Web Browser | Modern browsers | Render news articles | HTML5, CSS3, ES6+ |
| EP MCP Server | Local Node process | EP data access | Spawned locally via stdio JSON-RPC |
| LLM Service | External API | Content generation | API key authentication |
8 production article types are driven by 8 unified news-<type>.md workflows (Stage AโE in one ~45-min session, single PR per run). Article HTML is rendered deterministically by src/aggregator/article-generator.ts from committed Stage-B analysis artifacts โ there are no per-type strategy modules in the post-April-2026 pipeline.
| ๐ท๏ธ Article Type | ๐ค gh-aw Workflow | ๐ Cadence |
|---|---|---|
๐จ breaking |
news-breaking.md |
Every 6 hours |
๐ฎ week-ahead |
news-week-ahead.md |
Fri 07:00 UTC |
๐ week-in-review |
news-week-in-review.md |
Sat 09:00 UTC |
๐ month-ahead |
news-month-ahead.md |
1st of month 08:00 UTC |
๐ month-in-review |
news-month-in-review.md |
28th of month 10:00 UTC |
๐๏ธ committee-reports |
news-committee-reports.md |
MonโFri 04:00 UTC |
๐ณ๏ธ motions |
news-motions.md |
MonโFri 06:00 UTC |
โ๏ธ propositions |
news-propositions.md |
MonโFri 05:00 UTC |
Plus: news-translate.md (14-language translation helper, manual dispatch only).
All 9 news workflows are markdown source files compiled to YAML (.md โ .lock.yml) via the GitHub Agentic Workflows CLI (gh aw compile --validate) with pinned GH_AW_VERSION: v0.69.0 in .github/workflows/compile-agentic-workflows.yml. See WORKFLOWS.md for the full surface.
5-layer security model:
bash tool-call contract (every call requires command + description); shell expansion restrictionscreate-pull-request with max-patch-size (default 1024 KB; news-translate.md sets 10240 KB at top level for 14-language fan-out).lock.yml is the immutable executed artifact; .md is the human source under reviewMCP gateway (containerised): EP_MCP_GATEWAY_URL=http://host.docker.internal:80/mcp/european-parliament, provisioned by scripts/mcp-setup.sh.
Validator gates (Stage-C completeness review, agent-side โ replaces purged runtime validators):
.github/prompts/03-analysis-completeness-gate.md โ protocol that the editorial agent runsanalysis/methodologies/reference-quality-thresholds.json โ per-artifact line floorsls -t "news/${TODAY}-${TYPE}"*"-en.html" | head -1| Layer | Technology | Version | Purpose | Rationale |
|---|---|---|---|---|
| Runtime | Node.js | 25.x (engines: >=25); Node.js 26 LTS migration scheduled upon release (~Apr 2026) |
JavaScript execution environment | Current release for latest features, performance improvements; ESM-native ("type": "module") |
| Language | TypeScript | 6.0.3 | Primary development language | Strict type safety; compiles from src/ โ scripts/ targeting ES2025, module: NodeNext |
| Package Manager | npm | 10.x | Dependency management | Native Node.js package manager, security audit integration |
| Testing | Vitest | 4.1.4 | Unit and integration testing | Fast, ESM-native; happy-dom env; happy-dom@20.9.0 |
| E2E Testing | Playwright | 1.59.1 | End-to-end browser testing | @axe-core/playwright@4.11.2 for WCAG 2.1 AA |
| Linting | ESLint | 10.2.1 | Code quality and security | Flat config; plugins: eslint-plugin-sonarjs@4.0.3, eslint-plugin-security@4.0.0, eslint-plugin-jsdoc@62.9.0 |
| Formatting | Prettier | 3.8.3 | Code formatting | Opinionated formatter, consistent code style |
| Visualization | Chart.js | 4.5.1 | Dashboard charts in articles | Vendored into js/vendor/ via npm run copy-vendor |
| Visualization | D3 | 7.9.0 | Advanced visualizations | Used for specific intelligence views |
| Documentation | TypeDoc | 0.28.19 | API documentation generation | Generates docs/ pages from TypeScript sources |
| HTML Validation | HTMLHint | 1.9.2 | HTML5 validation | Pre-commit + CI |
| Duplicate Check | jscpd | 4.0.9 | Copy-paste detection | Scheduled quality audits |
| Technology | Current Version | Minimum Version | End-of-Life | Update Policy |
|---|---|---|---|---|
| Node.js | 25.x (current) | 25.0.0 (engines: >=25) |
~Apr 2026 (Current EOL; upgrading to Node.js 26 LTS) | Update to Node.js 26 LTS within days of release (~Apr 2026) |
| npm | 10.x (latest) | 10.0.0 | Follows Node.js lifecycle | Auto-updated with Node.js |
| TypeScript | 6.0.3 | 6.0.0 | N/A | Update to latest minor within 14 days, major within 90 days |
| Vitest | 4.1.4 | 4.0.0 | N/A | Update to latest minor within 14 days, major within 60 days |
| Playwright | 1.59.1 | 1.55.0 | N/A | Update to latest minor within 14 days, major within 60 days |
| ESLint | 10.2.1 | 10.0.0 | N/A | Update to latest minor within 14 days, major within 90 days |
| Prettier | 3.8.3 | 3.0.0 | N/A | Update to latest minor within 14 days, major within 90 days |
| Chart.js | 4.5.1 | 4.0.0 | N/A | Vendored; update with copy-vendor script |
| D3 | 7.9.0 | 7.0.0 | N/A | Vendored; update with copy-vendor script |
| TypeDoc | 0.28.19 | 0.28.0 | N/A | Major within 60 days |
| european-parliament-mcp-server | 1.2.13 (pinned) | 1.2.13 | Per upstream | Track releases; 1.2.11 (2026-04-20) fixes #377/#378 (fixed-window feeds, uniform unavailable envelope); 1.2.13 (2026-04-23) adds non-retryable UPSTREAM_404 for get_procedures, fixes search_documents envelope, enriches track_legislation timeline, improves get_procedures_feed error classification |
| worldbank-mcp | 1.0.1 (optional) | 1.0.0 | Per upstream | Biannual WDI refresh cadence |
| gh-aw CLI | v0.69.0 (pinned GH_AW_VERSION) |
v0.69.0 | Per upstream | Workflow-level pin in compile-agentic-workflows.yml |
Production Dependencies (1 required + 1 optional):
european-parliament-mcp-server@1.2.15 โ Primary data surface; 6 sliding-window feed tools (timeframe + startDate when custom) and 7 fixed-window feed tools (limit/offset only โ documents, plenary_documents, committee_documents, plenary_session_documents, parliamentary_questions, corporate_bodies, controlled_vocabularies); returns uniform {status:"unavailable", items:[]} envelope on upstream failure.worldbank-mcp@1.0.1 (optionalDependencies) โ WDI macro/social/environment/health indicators.IMF REST is integrated via native TypeScript fetch in src/mcp/imf-mcp-client.ts (class IMFMCPClient) โ this is NOT an MCP server; calls go directly to https://dataservices.imf.org/REST/SDMX_3.0/. Env: IMF_API_BASE_URL, IMF_API_TIMEOUT_MS. Supplies WEO + FM monthly forecasts up to five years ahead.
Dev dependencies (notable): vitest@4.1.4, @vitest/ui, @vitest/coverage-v8, happy-dom@20.9.0, @playwright/test@1.59.1, @axe-core/playwright@4.11.2, typescript@6.0.3, eslint@10.2.1, eslint-plugin-sonarjs@4.0.3, eslint-plugin-security@4.0.0, eslint-plugin-jsdoc@62.9.0, prettier@3.8.3, htmlhint@1.9.2, typedoc@0.28.19, chart.js@4.5.1, d3@7.9.0, papaparse@5.5.3, husky@9.1.7, jscpd@4.0.9.
| Tool | Purpose | Integration | Configuration |
|---|---|---|---|
| CodeQL | SAST scanning | GitHub Actions (weekly + PR) | .github/workflows/codeql.yml |
| Dependabot | Dependency vulnerability scanning | GitHub native (daily) | .github/dependabot.yml |
| npm audit | Dependency security check | Pre-commit + CI | package.json scripts |
| ESLint Security | Security-focused linting | Pre-commit + CI | eslint.config.js (security plugin) |
| HTMLHint | HTML validation | CI pipeline | .htmlhintrc |
| Husky | Git hooks | Pre-commit, pre-push | .husky/ directory |
| Playwright | Accessibility testing | E2E test suite | playwright.config.js (axe integration) |
| Service | Purpose | Configuration | Cost |
|---|---|---|---|
| GitHub Actions | CI/CD automation | .github/workflows/ | Free (public repo) |
| AWS S3 | Static site hosting | S3 bucket + static website | Pay-per-use (storage, requests) |
| Amazon CloudFront | Content delivery | CloudFront distribution (S3) | Pay-per-use (data transfer, requests) |
| Git | Version control | Repository | Free (public repo) |
| Service | Purpose | Protocol | Authentication | Rate Limits | Cost Model |
|---|---|---|---|---|---|
| European Parliament MCP Server | EP data access | Local process (stdio JSON-RPC) | None (local process) | N/A (handled by MCP server / EP APIs) | Free (EP open data via MCP server) |
| LLM Service (OpenAI/Anthropic) | Content generation | HTTPS/JSON | API key (required) | Varies by provider | Pay-per-token |
| GitHub API | Repository operations | REST/GraphQL | GitHub token | 5000 req/hr | Free (authenticated) |
| Browser | Minimum Version | Features Required | Testing Coverage |
|---|---|---|---|
| Chrome/Edge | 90+ | ES2020, CSS Grid, Flexbox | โ Playwright E2E (Chromium in CI) |
| Firefox | 88+ | ES2020, CSS Grid, Flexbox | ๐งช Manual regression (no Playwright CI) |
| Safari | 14+ | ES2020, CSS Grid, Flexbox | ๐งช Manual regression (no Playwright CI) |
| Mobile Chrome | 90+ | ES2020, Responsive Design | ๐งช Manual responsive testing |
| Mobile Safari | 14+ | ES2020, Responsive Design | ๐งช Manual responsive testing |
No support for:
TypeScript source in src/ is compiled to JavaScript in scripts/ via tsc. The generated JavaScript files are executed by Node.js during news generation. The public npm entry point is src/index.ts (published as euparliamentmonitor with SLSA Level 3 provenance attestations).
src/ โ scripts/ (tsc compilation)
โโโ index.ts โ index.js npm package entry point
โโโ constants/ โ constants/
โ โโโ config.ts Project paths, BASE_URL, filename patterns
โ โโโ analysis-constants.ts Shared analysis thresholds
โ โโโ committee-indicator-map.ts Committee โ indicator mapping
โ โโโ language-core.ts ALL_LANGUAGES (14), LANGUAGE_PRESETS
โ โโโ language-articles.ts Per-language article-type labels
โ โโโ language-ui.ts Per-language UI strings
โ โโโ languages.ts Language metadata (name, flag, direction)
โโโ mcp/ โ mcp/
โ โโโ ep-mcp-client.ts EP MCP stdio client; feed option types (no canonical EP_MCP_TOOLS export yet)
โ โโโ wb-mcp-client.ts World Bank MCP client; exports WORLD_BANK_MCP_TOOLS
โ โโโ imf-mcp-client.ts IMFMCPClient class (native fetch/SDMX 3.0); exports IMF_MCP_TOOLS
โ โโโ mcp-connection.ts Connection lifecycle
โ โโโ mcp-health.ts Health probes
โ โโโ mcp-retry.ts Exponential backoff retry
โโโ templates/ โ templates/
โ โโโ article-template.ts HTML5 article shell (SEO, JSON-LD, Open Graph)
โ โโโ section-builders.ts buildSiteFooter (single source of truth, 14-lang), stakeholder grid
โโโ aggregator/ โ aggregator/ โญ April-2026 deterministic article renderer
โ โโโ article-generator.ts Entry point CLI (`npm run generate-article`)
โ โโโ analysis-aggregator.ts aggregateAnalysisRun() โ manifest discovery, .md filter, Provenance & Audit at END
โ โโโ artifact-order.ts ARTIFACT_SECTIONS โ canonical 19-section order
โ โโโ clean-artifact.ts Strips SPDX/banner/provenance front matter
โ โโโ markdown-renderer.ts markdown-it + plugin allowlist (anchor, footnote, attrs, deflist)
โ โโโ article-html.ts HTML5 wrapper: header, language switcher, TOC sidebar, JSON-LD, hreflang
โ โโโ article-metadata.ts 5-tier editorial-highlight resolver for <title> / <meta description>
โโโ generators/ โ generators/ (post-aggregator-migration: only indexes & sitemap remain)
โ โโโ news-indexes.ts Per-language index pages
โ โโโ sitemap.ts XML sitemap generator + per-language sitemap_<lang>.html
โโโ types/ โ types/
โ โโโ analysis.ts, common.ts, generation.ts, imf.ts, intelligence.ts, mcp.ts,
โ โ parliament.ts, political-classification.ts, political-risk.ts,
โ โ political-threats.ts, quality.ts, significance.ts, stakeholder.ts,
โ โ visualization.ts, world-bank.ts, index.ts
โโโ utils/ โ utils/
โโโ article-category.ts, article-quality-scorer.ts, content-metadata.ts,
โโโ file-utils.ts, html-sanitize.ts, imf-data.ts,
โโโ intelligence-analysis.ts, intelligence-index.ts, metadata-utils.ts,
โโโ news-metadata.ts, political-classification.ts,
โโโ political-risk-assessment.ts, political-threat-assessment.ts,
โโโ significance-scoring.ts, world-bank-data.ts
(content-validator.ts, validate-articles.ts, validate-analysis-completeness.ts
PURGED in April-2026 โ replaced by Stage-C agent-side review)
Key build / generation commands:
npm run build โ Runs tsc (TypeScript compilation src/ โ scripts/)npm run lint โ ESLint on src/npm run generate-news โ Orchestrates strategies via the pipelinenpm run generate-news-indexes โ Executes scripts/generators/news-indexes.js (prebuild hook)npm run generate-sitemap โ Executes scripts/generators/sitemap.js (prebuild hook)npm run copy-vendor โ Vendors chart.js and d3 assets into js/vendor/npm run test / test:unit / test:integration / test:e2e / test:coverage โ Test suite (52 test files, 3061+ passing tests)TypeScript configuration (tsconfig.json):
target: ES2025, module: NodeNext, strict: true, rootDir: ./src, outDir: ./scripts, "type": "module" in package.jsonRuntime JS (browser):
js/index-runtime.js โ Index page filter + theme togglejs/article-runtime.js โ Reading progress + theme togglejs/vendor/ โ Vendored Chart.js (4.5.1) and D3 (7.9.0)TypeScript configuration (tsconfig.json):
target: ES2025 โ Modern JavaScript outputmodule: NodeNext โ Node.js native ESM resolutionstrict: true โ Full strict mode enabledrootDir: ./src โ TypeScript source rootoutDir: ./scripts โ Compiled JavaScript outputsequenceDiagram
participant GHA as GitHub Actions
participant CLI as CLI Interface
participant Gen as Article Generator
participant MCP as MCP Client
participant EP as EP MCP Server
participant TPL as Template Engine
participant FS as File System
GHA->>CLI: Trigger daily workflow
CLI->>Gen: generate-news --types=week-ahead --languages=all
Gen->>MCP: getPlenarySessions
Note over MCP,EP: MCP client spawns EP MCP Server as local process via stdio JSON-RPC
MCP->>EP: JSON-RPC request via stdio
EP-->>MCP: EP data as JSON-RPC response
MCP-->>Gen: Parsed EP data with basic shape checks
loop For each language sequentially
Gen->>TPL: Render HTML with EP data and language
Note over Gen,TPL: Placeholder English body content - native per-language LLM generation planned
TPL-->>Gen: HTML output
Gen->>FS: Write article file
end
Gen->>FS: Write metadata.json via writeFileSync
GHA->>GHA: Commit and push changes
GHA->>GHA: Deploy to S3 + invalidate CloudFront
sequenceDiagram
participant User as User Browser
participant CDN as CloudFront CDN
participant S3 as Amazon S3
participant Repo as Git Repository
User->>CDN: GET /index.html
CDN->>S3: Forward request (cache miss)
S3-->>CDN: HTML response
CDN-->>User: Cached HTML
User->>CDN: GET /news/week-ahead-2026-02-17-en.html
CDN-->>User: Cached article (or fetch from S3)
Cross-cutting concerns are aspects of the system that affect multiple components and layers. These concerns are implemented consistently across the entire architecture.
Logging Levels:
| Level | Usage | Output | Retention |
|---|---|---|---|
| ERROR | Unrecoverable errors (API failures, file write errors) | console.error(), GitHub Actions logs |
90 days (GitHub) |
| WARN | Recoverable issues (MCP connection retry/backoff, MCP tool fallback, JSON.parse recovery) | console.warn(), GitHub Actions logs |
90 days (GitHub) |
| INFO | Normal operations (generation start/complete, article count) | console.log(), GitHub Actions logs |
90 days (GitHub) |
| DEBUG | Detailed diagnostics (API responses, intermediate data) | Disabled in production | Dev only |
Structured Logging Format:
{
timestamp: "2026-02-20T10:30:00.000Z",
level: "INFO",
component: "ArticleGenerator",
action: "generate_article",
language: "en",
article_type: "week-ahead",
duration_ms: 1234,
status: "success"
}
Logging Implementation:
graph TB
subgraph "Generation Monitoring"
Workflow[GitHub Actions Workflow]
GenMetrics[Generation Metrics<br/>Article count, Duration, Errors]
TestResults[Test Results<br/>Unit, Integration, E2E]
end
subgraph "Application Monitoring"
Pages[Amazon CloudFront + S3]
Analytics[Web Analytics<br/>Visits, Bounce Rate, Countries]
Uptime[Uptime Monitoring<br/>AWS Health Dashboard]
end
subgraph "Security Monitoring"
Dependabot[Dependabot Alerts]
CodeQL[CodeQL Security Scans]
Audit[npm audit]
end
subgraph "Alerting"
Email[Email Notifications]
GitHubUI[GitHub UI Alerts]
Status[Status Checks]
end
Workflow -->|Logs| GenMetrics
Workflow -->|Results| TestResults
Pages -->|Metrics| Analytics
Pages -->|Health| Uptime
Dependabot -->|Alerts| Email
CodeQL -->|Findings| GitHubUI
Audit -->|Vulnerabilities| Status
GenMetrics -->|Failures| Email
TestResults -->|Failures| Status
style Dependabot fill:#f99,stroke:#333,stroke-width:2px
style CodeQL fill:#f99,stroke:#333,stroke-width:2px
Monitoring Tools:
| Metric | Tool | Threshold | Alert |
|---|---|---|---|
| Build Success Rate | GitHub Actions | <95% over 7 days | Email to maintainers |
| Generation Duration | Workflow logs | >15 minutes | Warning annotation |
| Test Pass Rate | Vitest + Playwright | <100% | Block merge |
| Security Vulnerabilities | Dependabot + CodeQL | Any high/critical | Email + PR |
| Site Availability | AWS Health Dashboard | <99.9% | AWS Health event notification |
| Page Load Time | Lighthouse (manual runs) | >3 seconds | Warning annotation |
Error Handling Strategy:
flowchart TD
Start([API Call / Operation])
Try{Try Operation}
Success[โ
Success]
Catch{Catch Error}
Transient{Transient<br/>Error?}
Retry[Retry with<br/>Exponential Backoff]
MaxRetries{Max Retries<br/>Reached?}
Fallback{Fallback<br/>Available?}
UseFallback[Use Fallback Data]
LogError[Log Error]
PropagateError[Propagate Error]
GracefulDegradation[Graceful Degradation]
Start --> Try
Try -->|Success| Success
Try -->|Error| Catch
Catch --> Transient
Transient -->|Yes| Retry
Transient -->|No| Fallback
Retry --> MaxRetries
MaxRetries -->|No| Try
MaxRetries -->|Yes| Fallback
Fallback -->|Yes| UseFallback
Fallback -->|No| LogError
UseFallback --> GracefulDegradation
LogError --> PropagateError
style Success fill:#9f9,stroke:#333,stroke-width:2px
style LogError fill:#f99,stroke:#333,stroke-width:2px
style PropagateError fill:#f99,stroke:#333,stroke-width:2px
style GracefulDegradation fill:#ff9,stroke:#333,stroke-width:2px
Error Categories and Handling:
| Error Category | Examples | Retry Strategy | Fallback | User Impact |
|---|---|---|---|---|
| Transient Network Errors | MCP connection failure during startup, LLM API rate limit | Exponential backoff (1s, 2s, 4s), max 3 retries for MCP connection establishment and LLM calls; individual MCP requests use a single fixed timeout with no retry | Use placeholder events or skip affected items (no cache) | Missing or placeholder content for affected items |
| Permanent API Errors | Invalid API key, malformed request | No retry | Skip article generation for affected language | Missing article for specific language |
| Data Validation Errors | Invalid EP data structure, missing required fields | No automatic regeneration loop | Skip invalid items (no cached-data fallback) | Missing content for invalid items |
| File System Errors | Disk full, permission denied | No retry | Fail workflow | Build failure (no deployment) |
| Content Generation Errors | LLM refusal, prompt injection detected | Single generation attempt (no automatic regeneration loop) | Insert placeholder events when content generation fails | Reduced content quality or placeholder content |
Error Propagation:
14 Languages Supported:
i18n Architecture:
graph LR
subgraph "Content Generation"
EPData[EP Data<br/>Language-Neutral]
LLM[LLM Service]
Prompt[Language-Specific Prompt]
end
subgraph "14 Language Variants"
EN[English Article]
SV[Swedish Article]
DA[Danish Article]
NO[Norwegian Article]
FI[Finnish Article]
DE[German Article]
FR[French Article]
ES[Spanish Article]
NL[Dutch Article]
AR[Arabic Article]
HE[Hebrew Article]
JA[Japanese Article]
KO[Korean Article]
ZH[Chinese Article]
end
subgraph "Delivery"
Index[Language-Specific<br/>Index Pages]
Sitemap[Multilingual<br/>Sitemap.xml]
end
EPData --> LLM
Prompt --> LLM
LLM --> EN
LLM --> SV
LLM --> DA
LLM --> NO
LLM --> FI
LLM --> DE
LLM --> FR
LLM --> ES
LLM --> NL
LLM --> AR
LLM --> HE
LLM --> JA
LLM --> KO
LLM --> ZH
EN --> Index
DE --> Index
FR --> Index
ES --> Index
Index --> Sitemap
style EPData fill:#9cf,stroke:#333,stroke-width:2px
style LLM fill:#fc9,stroke:#333,stroke-width:2px
i18n Implementation:
| Aspect | Implementation | Example |
|---|---|---|
| Content Generation | Placeholder English content for all languages (current); native LLM per-language generation planned (ADR-004) | Current: shared English body with localized titles/subtitles; Future: each article written directly in target language |
| File Naming | Language suffix in filename | week-ahead-2026-02-17-en.html, week-ahead-2026-02-17-de.html |
| HTML lang Attribute | Set per page | <html lang="en">, <html lang="de"> |
| Navigation | Language-specific index pages | index.html, index-de.html |
| SEO | hreflang tags for alternate languages | <link rel="alternate" hreflang="de" href="..."> |
| Date Formatting | Locale-specific date formats | EN: "February 17, 2026", DE: "17. Februar 2026" |
| Character Encoding | UTF-8 for all languages | <meta charset="UTF-8"> |
Language Quality Assurance:
Architecture Decision Records document significant architectural decisions made during the design and development of EU Parliament Monitor. Each ADR captures the context, decision, and consequences of a specific architectural choice.
Status: Accepted
Date: 2025-12-01
Decision Makers: CEO, Development Team
Context:
Decision: We will build EU Parliament Monitor as a static site generator rather than a dynamic web application with backend services.
Rationale:
Alternatives Considered:
Consequences:
Compliance: Aligns with ISO 27001 A.8.28 (Secure Development), NIST CSF PR.DS-5 (Minimal Attack Surface)
Status: Accepted
Date: 2025-12-05
Decision Makers: CEO, DevOps Team
Context:
Decision:
We will host EU Parliament Monitor on AWS S3 with Amazon CloudFront as the global CDN (see .github/workflows/deploy-s3.yml).
Rationale:
Alternatives Considered:
Consequences:
Compliance: Aligns with ISO 27001 A.8.24 (Cryptography - HTTPS), CIS Control 1 (Asset Management)
Status: Accepted
Date: 2025-12-10
Decision Makers: CEO, Data Team
Context:
Decision: We will access European Parliament data via the European Parliament MCP Server using the Model Context Protocol (MCP) rather than calling official EP APIs directly.
Rationale:
Alternatives Considered:
Consequences:
Compliance: Aligns with ISO 27001 A.8.3 (Input Validation), NIST CSF PR.DS-2 (Data in Transit Protection)
Status: Accepted
Date: 2025-12-15
Decision Makers: CEO, Content Team
Context:
Decision: We will generate content natively in each language using LLMs rather than translating from a base language.
Rationale:
Alternatives Considered:
Consequences:
Compliance: Aligns with Hack23 AI Policy (Transparency, Human Oversight), ISO 27001 A.5.10 (Information Processing)
Status: Accepted
Date: 2026-01-05
Decision Makers: CEO, Development Team
Context:
Decision:
We will use TypeScript (strict mode) as the primary development language, compiling from src/ to scripts/ targeting ES2025.
Rationale:
tsc compiles src/*.ts โ scripts/*.js; rootDir: ./src, outDir: ./scripts, target: ES2025, module: NodeNextAlternatives Considered:
Consequences:
npm run build / tsc) before executionCompliance: Aligns with Hack23 Secure Development Policy (Type Safety Principle), ISO 27001 A.8.28 (Secure Coding)
Status: Accepted
Date: 2026-04-27
Decision Makers: CEO, Development Team
Context:
week-in-review data window was D-0 โ D-7 (the most-recent 7 days).analysis/daily/2026-04-26/week-in-review/intelligence/methodology-reflection.md ยง3.1 recommended shifting to a D-36 โ D-8 window to systematically capture voting data.Decision:
We shift the week-in-review analysis window to D-36 โ D-8 (start = D-36, end = D-8 โ a 28-day window ending 8 days ago, relative to the run date). This direction matches the workflow's DATE_FROM (start = D-36) โ DATE_TO (end = D-8) variables. It is a 4-week look-back that consistently captures at least one full EP plenary week with published roll-call votes.
Rationale:
WEEKLY_REVIEW_TITLES subtitles (all 14 languages) now read "last full reporting week" instead of "past week" to accurately describe the shifted window to readers.dateFromโdateTo window, so canonical URLs remain accurate without additional changes.Alternatives Considered:
Consequences:
week-in-review run now reliably contains roll-call voting data.DATE_FROM / DATE_TO variables replace LAST_WEEK in week-in-review Stage A bash blocks; other workflows still using LAST_WEEK require separate migration if their reporting windows are changed.Implementation:
src/aggregator/article-metadata.ts: New deriveReportingWindowForWeekInReview() export computes D-36/D-8 from the article date; buildTemplateFallback uses it for week-in-review..github/workflows/news-week-in-review.md: Stage A sets DATE_FROM (D-36) and DATE_TO (D-8); all MCP tool calls use these variables; LAST_WEEK removed.src/constants/language-articles.ts: WEEKLY_REVIEW_TITLES subtitles updated (14 languages).Compliance: Aligns with Hack23 AI Policy (unambiguous date semantics in published articles), GDPR (accurate published metadata).
Non-functional requirements define system qualities that are not directly related to specific features but are critical to overall system success.
| Requirement | Target | Measurement | Current Status |
|---|---|---|---|
| Page Load Time (Desktop) | <1 second (LCP) | Lighthouse (manual runs) | โ 0.6s average |
| Page Load Time (Mobile) | <2 seconds (LCP) | Lighthouse (manual runs) | โ 1.2s average |
| Build Time (All Languages) | <15 minutes | GitHub Actions logs | โ 8-12 minutes |
| Article Generation (Single) | <30 seconds | Script logs | โ 15-25 seconds |
| MCP API Response Time | <2 seconds (p95) | Client logs | โ 1.1s average |
| CDN Cache Hit Rate | >95% | CloudFront metrics (planned) | โณ TBD โ instrumentation planned |
Performance Optimization Strategies:
| Dimension | Current Capacity | Target Capacity | Scaling Strategy |
|---|---|---|---|
| Concurrent Users | Unlimited (static content) | Unlimited | CDN auto-scales |
| Daily Visitors | 10,000+ | 100,000+ | CDN bandwidth increase |
| Articles per Day | 14 (one per language) | 140 (ten per language) | Parallel generation, workflow optimization |
| Supported Languages | 14 | 24+ (expanded markets) | Add language configs, LLM prompts |
| Repository Size | 150 MB | 800 MB (GitHub limit) | Archive old articles annually |
Scalability Constraints:
| Requirement | Target | Measurement | Consequence of Failure |
|---|---|---|---|
| Site Availability | 99.9% (AWS CloudFront/S3 SLA) | GitHub Status + AWS Health Dashboard | Users cannot access news |
| Build Success Rate | >98% | GitHub Actions logs | No new content deployed |
| MCP API Availability | >99% (best effort) | Health checks | Fallback to placeholder events (no cached/previous data) |
| LLM API Availability | >99.5% (provider SLA) | API logs | Generation fails, retry logic |
| Recovery Time Objective (RTO) | <15 minutes | Manual testing | Time to restore service after outage |
| Recovery Point Objective (RPO) | <24 hours | Git history | Maximum data loss acceptable |
High Availability Strategies:
| Requirement | Implementation | Verification | Compliance |
|---|---|---|---|
| HTTPS-Only | CloudFront enforces HTTPS redirect via ACM certificate | Manual testing | ISO 27001 A.8.24 |
| Content Security Policy (CSP) | Planned strict CSP via CloudFront response headers (no CSP meta tag in HTML templates currently) | CSP Evaluator (staging/production) | ISO 27001 A.8.23 |
| No Secrets in Repository | GitHub Secrets for API keys | Git history scan | ISO 27001 A.8.3 |
| Dependency Vulnerability Scanning | Dependabot daily scans | GitHub Security tab | CIS Control 10 |
| SAST (Static Application Security Testing) | CodeQL weekly + PR | GitHub Code Scanning | ISO 27001 A.8.28 |
| Access Control | GitHub RBAC, branch protection | Repository settings | CIS Control 6 |
| Audit Logging | GitHub audit logs, workflow logs | Logs API | ISO 27001 A.8.15 |
| Data Classification | All content PUBLIC | CLASSIFICATION.md | ISO 27001 A.5.10 |
| Incident Response | SECURITY.md procedures | Quarterly reviews | NIST CSF RS.RP |
Security Testing:
| Criterion | Requirement | Implementation | Testing |
|---|---|---|---|
| Perceivable | Text alternatives, adaptable content, distinguishable | Semantic HTML5, alt text, contrast ratios | Playwright axe tests |
| Operable | Keyboard accessible, enough time, navigable, input modalities | Focus management, skip links, ARIA labels | Manual keyboard testing |
| Understandable | Readable, predictable, input assistance | lang attributes, consistent navigation, form labels | Lighthouse accessibility |
| Robust | Compatible with assistive technologies | Valid HTML5, ARIA roles | HTML validator |
Accessibility Targets:
Accessibility Testing:
| Metric | Target | Current | Tool |
|---|---|---|---|
| Code Coverage | >80% lines | 82% | Vitest |
| Branch Coverage | >80% branches | 83% | Vitest |
| Cognitive Complexity | <15 per function | <10 average | ESLint sonarjs cognitive-complexity rule |
| Code Duplication | <3% | <2% | Manual review |
| Documentation Coverage | 100% public APIs | 95% | JSDoc, manual review |
| Build Time | <5 minutes (tests only) | 3-4 minutes | GitHub Actions |
Maintainability Practices:
eslint-plugin-sonarjs@4.0.3, eslint-plugin-security@4.0.0, eslint-plugin-jsdoc@62.9.0; Prettier 3.8.3 formattingeuropean-parliament-mcp-server for build-time data access), only dev dependencies otherwiseeuropean-parliament-mcp-server@1.2.15), 1 optional (worldbank-mcp@1.0.1), ~40 dev dependencies