EU Parliament Monitor โ€” API Documentation - v0.8.49
    Preparing search index...

    Hack23 Logo

    ๐Ÿค Contributing to EU Parliament Monitor

    Code ยท Tests ยท Docs ยท Translations ยท Political Intelligence ยท Security
    ๐Ÿ‡ช๐Ÿ‡บ Civic-tech for European democracy ยท ๐Ÿ›ก๏ธ Security-by-design ยท ๐ŸŒ 14 languages ยท โ™ฟ WCAG 2.1 AA

    Owner Version Classification Review Cycle Effective

    Code of Conduct Security Policy Hack23 ISMS OpenSSF Best Practices

    ๐Ÿ“‹ Document Owner: CEO | ๐Ÿ“„ Version: 1.2 | ๐Ÿ“… Last Updated: 2026-04-27 (UTC) ๐Ÿ”„ Review Cycle: Quarterly | โฐ Next Review: 2026-07-27 | ๐Ÿท๏ธ Classification: Public


    Thank you for your interest in contributing to EU Parliament Monitor โ€” the open-source European Parliament political-intelligence platform that publishes AI-generated, evidence-based analysis in 14 languages every day. We welcome contributions from developers, journalists, translators, political scientists, OSINT analysts, accessibility advocates, and security researchers.

    This project adheres to the Contributor Covenant 2.1. By participating, you agree to maintain a respectful and inclusive environment. Report unacceptable behaviour to conduct@hack23.com.

    ๐ŸŽญ Role ๐ŸŽฏ What you can do
    ๐Ÿ‘จโ€๐Ÿ’ป Developers TypeScript aggregator, MCP integrations, GitHub Actions, accessibility, performance
    ๐Ÿ“ฐ Journalists Editorial style review, political analysis quality, source attribution discipline
    ๐ŸŒ Translators Improve any of the 14 languages (EN, SV, DA, NO, FI, DE, FR, ES, NL, AR, HE, JA, KO, ZH)
    ๐Ÿง  Political scientists / OSINT analysts Methodologies under analysis/methodologies/, threat-framework refinement, ACH/SWOT/PESTLE rigor
    โ™ฟ Accessibility advocates WCAG 2.1 AA audits, RTL improvements (Arabic, Hebrew), screen-reader testing
    ๐Ÿ›ก๏ธ Security researchers Responsible disclosure via SECURITY.md โ€” see also SECURITY_ARCHITECTURE.md and THREAT_MODEL.md
    ๐Ÿ“š Doc authors Architecture docs (ARCHITECTURE.md), C4 diagrams, ADRs, runbooks
    • ๐ŸŸข Node.js โ‰ฅ 25 (the platform runtime โ€” see package.json engines.node)
    • ๐Ÿ“ฆ npm โ‰ฅ 10 (ships with Node.js 25)
    • ๐Ÿ”ง Git
    1. Fork the repository
    2. Clone your fork:
      git clone https://github.com/YOUR_USERNAME/euparliamentmonitor.git
      cd euparliamentmonitor
    3. Install dependencies:
      npm install
      
    4. Create a branch for your changes:
      git checkout -b feature/your-feature-name
      
    # Render an article from analysis artifacts (manual testing)
    npm run generate-article -- --run analysis/daily/2025-01-01/week-ahead

    # Generate index pages
    npm run generate-news-indexes

    # Generate sitemap
    npm run generate-sitemap

    # Serve locally
    npm run serve

    Before committing, run these checks:

    # Lint your code
    npm run lint

    # Auto-fix linting issues
    npm run lint:fix

    # Format your code
    npm run format

    # Check formatting
    npm run format:check

    # Validate HTML
    npm run htmlhint

    All contributions must meet these quality standards:

    All contributions must include appropriate tests:

    • Unit Tests: Write unit tests for new functions and modules
    • Integration Tests: Add integration tests for new workflows
    • Coverage: Maintain โ‰ฅ80% line coverage, โ‰ฅ75% branch coverage
    • Test Quality: Follow AAA pattern (Arrange, Act, Assert)
    • No Flaky Tests: Ensure tests are deterministic and reliable
    # Run unit & integration tests
    npm test

    # Check coverage
    npm run test:coverage

    # Run specific test file
    npx vitest test/unit/your-test.test.js
    • E2E Tests: Add E2E tests for user-facing features
    • Accessibility: Ensure WCAG 2.1 AA compliance
    • Responsive Design: Test on mobile and desktop viewports
    • Cross-Browser: Tests run on Chromium, Firefox, and WebKit
    # Run E2E tests
    npm run test:e2e

    # Run with UI (interactive debugging)
    npm run test:e2e:ui

    # Run in headed mode (see browser)
    npm run test:e2e:headed

    When to add E2E tests:

    • New user-facing features (navigation, forms, etc.)
    • Changes to page structure or layout
    • Multi-language functionality changes
    • Accessibility improvements
    • Responsive design changes

    Required for all code changes:

    • New functions must have unit tests
    • New features must have integration tests
    • User-facing features should have E2E tests
    • All tests must pass before PR submission
    • Coverage thresholds must be met
    • Zero errors required (warnings are acceptable for false positives)
    • All functions must have complete JSDoc documentation
    • Code complexity must be โ‰ค15 (cognitive complexity)
    • No security vulnerabilities (eval, unsafe regex, etc.)
    • All JavaScript files must be formatted with Prettier
    • Use the project's .prettierrc.json configuration
    • 100 character line width
    • Single quotes for strings

    All exported functions must include:

    /**
    * Brief function description
    * @param {type} paramName - Parameter description
    * @returns {type} Return value description
    */

    Security Architecture: All security changes must align with the Security Architecture and ISMS Secure Development Policy.

    Security Requirements:

    • Never commit secrets or API keys
    • Use === instead of ==
    • Avoid eval() and new Function()
    • Validate all user inputs (see Security Controls)
    • Prevent XSS vulnerabilities (multi-layer defense: validation, sanitization, encoding, CSP)
    • No SQL injection risks (static site, no databases)
    • Test security-critical paths (โ‰ฅ95% coverage)
    • Follow threat model mitigations (see Threat Model)

    Security Review Checklist:

    • [ ] Input validation implemented for all external data
    • [ ] HTML sanitization applied (script tags, event handlers removed)
    • [ ] Output encoding used (HTML entity encoding)
    • [ ] No new dependencies without security scanning (npm audit)
    • [ ] Security tests added for new attack surfaces
    • [ ] Documentation updated (SECURITY_ARCHITECTURE.md if applicable)
    • [ ] Threat model reviewed for new threats

    Security Testing:

    # Run security audit
    npm audit

    # Run security-focused tests
    npm run test:unit -- --grep="security|xss|injection|sanitize"

    # Check for vulnerable dependencies
    npm audit --audit-level=moderate

    The project uses Husky and lint-staged to automatically:

    1. Run ESLint with auto-fix on staged JavaScript files
    2. Format staged files with Prettier
    3. Validate HTML files with htmlhint
    4. Run affected tests (if configured)

    These hooks run automatically on git commit. To bypass (not recommended):

    git commit --no-verify
    

    Use conventional commits format:

    <type>(<scope>): <description>

    [optional body]

    [optional footer]
    • feat: New feature
    • fix: Bug fix
    • docs: Documentation changes
    • style: Code style changes (formatting, etc.)
    • refactor: Code refactoring
    • test: Adding or updating tests (use this for test-related commits!)
    • chore: Maintenance tasks
    • ci: CI/CD changes
    git commit -m "feat(news): add breaking news article type"
    git commit -m "fix(mcp): handle connection timeout gracefully"
    git commit -m "docs: update code standards documentation"
    git commit -m "refactor(generator): reduce complexity in generateWeekAhead"
    git commit -m "test: add unit tests for article template"
    git commit -m "test: increase coverage for MCP client"
    1. Run all quality checks:

      npm run lint
      npm run format:check
      npm run htmlhint
      npm test
      npm run test:e2e
    2. Check test coverage:

      npm run test:coverage
      # Ensure coverage thresholds are met
      # Lines: โ‰ฅ80%, Branches: โ‰ฅ75%
    3. Test your changes:

      # Render an article from analysis (if applicable)
      npm run generate-article -- --run analysis/daily/YYYY-MM-DD/week-ahead

      # Verify output
      npm run generate-news-indexes
      npm run generate-sitemap

      # Test E2E (if UI changes)
      npm run test:e2e:headed
    4. Update documentation if you've:

      • Added new features
      • Changed APIs or interfaces
      • Modified configuration
      • Added new test files (update test/README.md or e2e/README.md)
    • [ ] Code follows the project's code standards
    • [ ] All ESLint checks pass (0 errors)
    • [ ] Code is formatted with Prettier
    • [ ] All functions have JSDoc documentation
    • [ ] All unit & integration tests pass (npm test)
    • [ ] E2E tests pass (npm run test:e2e) (if UI changes)
    • [ ] Test coverage meets thresholds (โ‰ฅ80% lines, โ‰ฅ75% branches)
    • [ ] New code has corresponding tests
    • [ ] No security vulnerabilities introduced
    • [ ] Documentation updated (if needed)
    • [ ] Commit messages follow conventional commits format

    Include in your PR description:

    1. What: Brief description of the change
    2. Why: Reason for the change
    3. How: Technical approach used
    4. Testing: How you tested the changes
    5. Screenshots: For UI changes

    Your PR must pass these automated checks:

    • โœ… ESLint (zero errors)
    • โœ… Prettier formatting
    • โœ… HTML validation
    • โœ… JavaScript syntax check
    • โœ… Unit tests
    • โœ… Integration tests
    • โœ… E2E tests (runs daily and on PRs)
    • โœ… Coverage thresholds (80%/75%)
    • โœ… Security audit (npm audit)
    • โœ… Functional tests
    1. Automated checks must pass
    2. At least one maintainer review required
    3. All review comments must be addressed
    4. PR will be merged by a maintainer
    euparliamentmonitor/
    โ”œโ”€โ”€ .github/ # GitHub workflows and configuration
    โ”‚ โ”œโ”€โ”€ workflows/ # CI/CD workflows + agentic workflows (news-*.md)
    โ”‚ โ””โ”€โ”€ agents/ # Custom GitHub Copilot agents
    โ”œโ”€โ”€ scripts/ # Compiled JavaScript from src/
    โ”‚ โ”œโ”€โ”€ aggregator/ # Article generation aggregator
    โ”‚ โ”œโ”€โ”€ generators/ # Index & sitemap generators
    โ”‚ โ””โ”€โ”€ mcp/ # MCP clients
    โ”œโ”€โ”€ src/ # TypeScript source
    โ”‚ โ”œโ”€โ”€ aggregator/ # Analysis aggregation + article rendering
    โ”‚ โ”œโ”€โ”€ generators/ # Sitemap, indexes, political intelligence
    โ”‚ โ”œโ”€โ”€ mcp/ # MCP client implementations
    โ”‚ โ”œโ”€โ”€ utils/ # Utilities (file, metadata, sanitize)
    โ”‚ โ”œโ”€โ”€ types/ # TypeScript type definitions
    โ”‚ โ””โ”€โ”€ constants/ # Configuration constants
    โ”œโ”€โ”€ test/ # Unit & integration tests
    โ”‚ โ”œโ”€โ”€ unit/ # Unit tests
    โ”‚ โ”œโ”€โ”€ integration/ # Integration tests
    โ”‚ โ”œโ”€โ”€ fixtures/ # Test data
    โ”‚ โ””โ”€โ”€ helpers/ # Test utilities
    โ”œโ”€โ”€ e2e/ # End-to-end tests
    โ”‚ โ”œโ”€โ”€ tests/ # E2E test files
    โ”‚ โ””โ”€โ”€ README.md # E2E testing guide
    โ”œโ”€โ”€ news/ # Generated news articles
    โ”œโ”€โ”€ docs/ # Documentation
    โ”‚ โ””โ”€โ”€ CODE_STANDARDS.md # Code quality standards
    โ”œโ”€โ”€ .husky/ # Pre-commit hooks
    โ”œโ”€โ”€ eslint.config.js # ESLint configuration
    โ”œโ”€โ”€ .prettierrc.json # Prettier configuration
    โ”œโ”€โ”€ playwright.config.js # Playwright E2E configuration
    โ””โ”€โ”€ package.json # Dependencies and scripts

    EU Parliament Monitor ships with a layered agent catalog under .github/agents/ โ€” product-domain agents that own the news critical path, plus infrastructure agents that maintain workflow and CI hygiene. See .github/agents/README.md for the full directory and the .github/skills/ and .github/prompts/ libraries that they share.

    Agent Role
    ๐Ÿ•ต๏ธ @intelligence-operative Senior political-intelligence analyst โ€” applies ACH, SWOT, PESTLE, OSINT tradecraft, threat framework. Owns Stage-B analysis artifacts.
    ๐Ÿ“ฐ @news-journalist The Economist-style EP reporting in 14 languages. Authors editorial prose only when analysis artifacts are signed off.
    ๐Ÿ”„ @data-pipeline-specialist EP MCP integration (60+ tools), data quality, voting-records fallback to EP Open Data Portal.
    ๐ŸŽจ @frontend-specialist HTML5/CSS3, WCAG 2.1 AA accessibility, multi-language UI, RTL support.
    โœ… @quality-engineer Vitest + Playwright, HTML validation, accessibility testing, performance benchmarking.
    โš™๏ธ @devops-engineer gh-aw workflow compilation, GitHub Actions, S3/CloudFront deploy, MCP gateway.
    ๐Ÿ“š @documentation-architect C4 models, Mermaid diagrams, ARCHITECTURE.md, ADRs.
    ๐Ÿ›ก๏ธ @security-architect ISMS, GDPR, NIS2, EU CRA compliance โ€” reviews data classification of intelligence products.
    ๐Ÿ“‹ @product-task-agent Issue creation, ISMS tracking, capability-roadmap coordination.
    ๐Ÿ“ฃ @marketing-specialist Privacy-first multi-language engagement, GDPR-compliant outreach.
    ๐Ÿ’ผ @business-development-specialist Strategic planning, civic-tech partnerships, sustainable transparency models.

    agentic-workflows.agent.md ยท news-generation.agent.md ยท ci-cleaner.agent.md ยท contribution-checker.agent.md ยท create-safe-output-type.agent.md ยท custom-engine-implementation.agent.md ยท grumpy-reviewer.agent.md ยท interactive-agent-designer.agent.md ยท technical-doc-writer.agent.md ยท w3c-specification-writer.agent.md

    # View TypeScript compilation
    npm run build:check

    # Test article generation (requires existing analysis artifacts)
    npm run generate-article -- --run analysis/daily/YYYY-MM-DD/article-type

    VS Code Extensions:

    • ESLint
    • Prettier
    • HTMLHint

    VS Code Settings:

    {
    "editor.formatOnSave": true,
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
    }
    }
    • Open an issue for bugs or feature requests
    • Check docs/CODE_STANDARDS.md for code guidelines
    • Review existing code for examples
    • Contact maintainers via GitHub

    When contributing, be aware of how your changes may affect security badges:

    Your PR may affect the scorecard if it:

    • Modifies GitHub Actions workflows
    • Adds/removes dependencies
    • Changes branch protection settings
    • Adds security scanning tools

    Best Practices:

    • Pin all GitHub Actions to SHA hashes (not tags)
    • Use maintained, official actions when possible
    • Add security tests for new attack surfaces
    • Keep dependencies up-to-date

    All new files must include proper license headers or be covered by .reuse/dep5:

    For JavaScript files:

    // SPDX-FileCopyrightText: 2024-2026 Hack23 AB
    // SPDX-License-Identifier: Apache-2.0

    For configuration files: Add entries to .reuse/dep5 following existing patterns

    New code must maintain โ‰ฅ80% line coverage, โ‰ฅ75% branch coverage:

    • Add unit tests for new functions
    • Add integration tests for new workflows
    • Add E2E tests for user-facing features

    When SonarCloud is enabled, PRs will be checked for:

    • Code coverage (target: 80%)
    • Code smells and technical debt
    • Security vulnerabilities
    • Maintainability rating (target: A)

    See README.md - Badge Maintenance for detailed badge status and procedures.

    EU Parliament Monitor operates under the Hack23 ISMS framework. All contributions must align with these public policies โ€” both in code (Secure Development Policy) and in conduct (Acceptable Use Policy).

    ๐Ÿ›๏ธ Policy ๐ŸŽฏ Why it applies ๐Ÿ“Œ What you must do
    ๐Ÿ› ๏ธ Secure Development Policy All code changes go through SSDLC gates Threat-model new pipelines; pin actions to SHAs; no eval/dynamic code
    ๐Ÿ“‹ Information Security Policy Integrity of analysis + confidentiality of methodology notes Cite primary EP / IMF / World Bank sources; never leak credentials
    ๐Ÿค– AI Policy Analysis is AI-assisted and must be auditable Apply Pass-1 + Pass-2 review; disclose assumptions and uncertainty
    ๐Ÿท๏ธ Classification Policy Only public open-source material is used No paywalled, leaked, or embargoed material in artifacts
    ๐Ÿ› Vulnerability Management Severity-based remediation SLAs Follow the SECURITY.md disclosure timeline
    ๐Ÿ” Threat Modelling Policy New attack surfaces require STRIDE analysis Update THREAT_MODEL.md for changes that touch CIA assets
    ๐Ÿ” Cryptography Policy No deprecated algorithms (MD5, SHA-1, DES, 3DES) Use modern crypto only; rely on platform / OIDC primitives
    ๐Ÿš’ Incident Response Plan Coordinated handling of security incidents Notify security@hack23.com for any suspected incident
    ๐Ÿ“œ Open Source Policy Governance, licence headers, REUSE compliance Apache-2.0 SPDX headers on every new code file
    ๐Ÿ‡ช๐Ÿ‡บ CRA Conformity Assessment EU Cyber Resilience Act compliance See CRA-ASSESSMENT.md for the project conformity table
    Topic Document
    ๐Ÿ›๏ธ Architecture ARCHITECTURE.md ยท DATA_MODEL.md ยท FLOWCHART.md ยท STATEDIAGRAM.md ยท MINDMAP.md
    ๐Ÿ“ฐ Article generation Article-Generation.md โ€” full Stage Aโ†’E pipeline
    ๐Ÿง  Analysis methodology analysis/methodologies/ (17 methodologies) ยท analysis/templates/ (51 templates)
    ๐Ÿ›ก๏ธ Security SECURITY.md ยท SECURITY_ARCHITECTURE.md ยท THREAT_MODEL.md ยท CRA-ASSESSMENT.md ยท CLASSIFICATION.md
    โš™๏ธ CI/CD WORKFLOWS.md ยท .github/workflows/README.md ยท .github/prompts/README.md
    ๐Ÿงช Testing UnitTestPlan.md ยท E2ETestPlan.md ยท test/README.md ยท e2e/README.md
    ๐Ÿ’ผ Business / lifecycle SWOT.md ยท BCPPlan.md ยท End-of-Life-Strategy.md ยท FinancialSecurityPlan.md

    EU Parliament Monitor is part of the broader Hack23 civic-tech and security portfolio. Cross-pollination is welcome โ€” many architectural patterns and ISMS controls are shared.

    ๐Ÿ›๏ธ Project ๐ŸŽฏ Focus ๐Ÿ”— Link
    ๐ŸŒ Hack23 Homepage Organisation site, ISMS hub hack23.com ยท Hack23/homepage
    ๐Ÿ“œ ISMS-PUBLIC Public ISO 27001 / NIST CSF / CIS / GDPR / NIS2 / EU CRA policies Hack23/ISMS-PUBLIC
    ๐Ÿ”Œ European Parliament MCP Server TypeScript MCP server with 60+ EP open-data tools Hack23/European-Parliament-MCP-Server
    ๐Ÿ‡ธ๐Ÿ‡ช Riksdag Monitor Swedish Parliament monitor (sister project, foundation for this codebase) Hack23/riksdagsmonitor
    ๐Ÿ•ต๏ธ CIA Swedish Parliament intelligence platform (Java/Spring) Hack23/cia
    โœ… CIA Compliance Manager CIA-triad compliance dashboard (TypeScript) Hack23/cia-compliance-manager
    ๐Ÿฅ‹ Black Trigram Korean martial-arts game with security focus Hack23/blacktrigram

    By contributing, you agree that your contributions will be licensed under the Apache License 2.0 โ€” the same licence that covers the rest of the project. All new code files must include SPDX headers:

    // SPDX-FileCopyrightText: 2024-2026 Hack23 AB
    // SPDX-License-Identifier: Apache-2.0

    Configuration files without headers must be covered by entries in .reuse/dep5.


    ๐Ÿ™ Thank you for contributing to EU Parliament Monitor! ๐Ÿ‡ช๐Ÿ‡บ

    Maintained by Hack23 AB โ€” Intelligence Operations Team under the Hack23 ISMS framework.