Riksdagsmonitor Intelligence Platform โ€” API Documentation - v1.0.102
    Preparing search index...

    Hack23 Logo

    ๐Ÿท๏ธ Riksdagsmonitor โ€” Label System

    ๐Ÿค– Automated Pull-Request & Issue Categorisation
    ๐ŸŽฏ File-Path Routing ยท Title Detection ยท Body Heuristics ยท GitHub Actions Driven

    Owner Version Effective Date Review Cycle

    ๐Ÿ“‹ Document Owner: CEO | ๐Ÿ“… Last Updated: 2026-05-03 (UTC) | ๐Ÿข Owner: Hack23 AB (Org.nr 559534-7807) | ๐Ÿท๏ธ Classification: ๐ŸŸข Public

    ๐Ÿ†• What changed since last review (v1.0 โ†’ v1.1, 2026-05-03):

    • ๐Ÿ”„ Drift reconciliation with the live label set (gh label list --repo Hack23/riksdagsmonitor --limit 300): the repository now carries 159 labels (was 46 in v1.0). The categories below cover the original 46 plus 113 agentic-newsroom additions, grouped as:
      • Agent ownership: agent:news-journalist, agent:security-architect, agent:documentation-architect, agent:data-pipeline-specialist, agent:intelligence-operative
      • Component routing: component:content, component:visualization, component:i18n, component:navigation, component:news, component:ai-workflows, component:security, component:architecture, component:cia-data, component:data-integration, component:data-pipeline, component:workflow, component:strategy, component:future, component:performance, component:dashboard, component:documentation
      • Priority (canonical & legacy): priority:critical, priority:high, priority:medium, priority:low (legacy priority-critical, priority-high, priority-medium, priority-low still active)
      • Type: type:feature, type:documentation, type:security, type:accessibility, type:monitoring
      • Agentic newsroom: agentic-workflows, agentic-workflow, agentic-news, automated-news, news-generation, news-content, news-article, auto-generated, ai-generated, needs-editorial-review, analysis-data, analysis-only
      • Article horizons & types: realtime-monitor, realtime-pulse, evening-analysis, week-ahead, month-ahead, year-ahead, long-horizon, forward-look, weekly-review, monthly-review, committee-reports, propositions, motions, interpellations, interpellation-debates, opposition-motions, article:motions
      • Language tracks: lang:en, lang:sv, multi-language, translations
      • Pipeline: automated-pipeline, economic-context, cia-intelligence, data-update, heartbeat, news/content, content
      • Tooling: npm, github-actions, code-quality, frontend, refactoring, typescript, validation, maintenance
    • ๐Ÿ“‹ The taxonomy is documented categorically below; for the canonical machine-readable taxonomy see .github/labeler.yml and the setup workflow .github/workflows/setup-labels.yml.

    This document describes the automatic labeling system for the riksdagsmonitor repository. Labels are automatically applied to pull requests based on file changes, PR titles, and PR body content.


    The riksdagsmonitor repository uses an automated labeling system powered by GitHub Actions to categorize pull requests and issues. This helps maintain organization, improves searchability, and provides quick visual context about changes.

    • โœ… Automatic labeling based on file paths, PR titles, and descriptions
    • โœ… 159 labels total โ€” 46 base labels managed by setup-labels.yml + 113 labels created dynamically by agentic workflows, GitHub Actions labeler, and manual additions
    • โœ… Size labels automatically calculated from PR diff
    • โœ… Security hardened workflows with SHA pinning
    • โœ… Status tracking with priority and progress labels
    • โœ… Agentic-newsroom taxonomy: agent:* (per-Copilot-agent owner), component:* (subsystem), priority:* / priority-*, agentic-workflows, news-generation, needs-editorial-review, auto-generated, ai-generated, horizon tags (week-ahead, month-ahead, quarter-ahead, year-ahead, long-horizon, forward-look, realtime-monitor, realtime-pulse)

    Note: The setup-labels.yml workflow verifies exactly 46 base labels (the core taxonomy defined in the workflow itself). The remaining 113 labels are created on-the-fly by the agentic news workflows, the GitHub Actions labeler (.github/labeler.yml), and manual issue triage. The full live label set can be queried with gh label list --repo Hack23/riksdagsmonitor --limit 300.


    Run the label setup workflow to create all required labels:

    1. Go to Actions โ†’ Setup Repository Labels
    2. Click Run workflow
    3. (Optional) Check "Recreate all labels" to delete existing labels first
    4. Wait for completion (usually < 1 minute)

    Direct link: Setup Repository Labels Workflow

    Once labels are created, the automatic labeler runs on every PR:

    • Triggers on PR opened, synchronize, reopened, edited
    • Applies labels based on .github/labeler.yml configuration
    • Adds size labels based on diff statistics
    • Posts a summary comment on new PRs

    Labels for content generation and feature development:

    Label Color Description
    news #ff6b9d News articles and content generation
    dashboard #1e88e5 Interactive dashboards (Chart.js/D3.js)
    visualization #9c27b0 Data visualization features
    intelligence #6a1b9a Political intelligence analysis

    Auto-applies when:

    • Changing files in news/, dashboard/, js/*-dashboard.js
    • PR title starts with news:, dashboard:, viz:
    • PR body contains - [x] ๐Ÿ“ฐ News Content, - [x] ๐Ÿ“Š Dashboard

    Labels for technical implementation:

    Label Color Description
    html-css #e1bee7 HTML/CSS changes
    javascript #f9a825 JavaScript code changes
    workflow #1976d2 GitHub Actions workflows
    security #d32f2f Security improvements

    Auto-applies when:

    • Changing .html, .css, .js files
    • Modifying .github/workflows/ files
    • Updating security documentation
    • PR title starts with html:, js:, workflow:, security:

    Labels for data pipeline and integration:

    Label Color Description
    cia-data #00897b CIA platform data integration
    riksdag-data #0277bd Riksdag-Regering MCP data
    data-pipeline #00695c ETL and data processing
    schema #546e7a Data schema changes

    Auto-applies when:

    • Changing files in cia-data/, data/cia/, schemas/
    • Modifying scripts/load-cia-*.js, scripts/mcp-client.js
    • PR title starts with cia:, riksdag:, pipeline:, schema:

    Labels for multi-language support (14 languages):

    Label Color Description
    i18n #4caf50 Internationalization/localization
    translation #66bb6a Translation updates
    rtl #8bc34a RTL language support (Arabic, Hebrew)

    Auto-applies when:

    • Changing index_*.html, sitemap_*.html, news/**/*-*.html
    • Modifying TRANSLATION_GUIDE.md
    • PR title starts with i18n:, translation:, rtl:

    Supported Languages:

    • English (EN), Swedish (SV), Danish (DA), Norwegian (NO), Finnish (FI)
    • German (DE), French (FR), Spanish (ES), Dutch (NL)
    • Arabic (AR), Hebrew (HE), Japanese (JA), Korean (KO), Chinese (ZH)

    Labels for security and compliance frameworks:

    Label Color Description
    isms #b71c1c ISMS compliance changes
    iso-27001 #c62828 ISO 27001 controls
    nist-csf #d32f2f NIST CSF compliance
    cis-controls #e53935 CIS Controls

    Auto-applies when:

    • Changing SECURITY_ARCHITECTURE.md, THREAT_MODEL.md, CRA-ASSESSMENT.md
    • Modifying .github/skills/iso-27001-controls/, .github/skills/nist-csf-mapping/
    • PR title starts with isms:, iso-27001:, nist:, cis:

    Frameworks:

    • ISO 27001:2022 - Information security management
    • NIST CSF 2.0 - Cybersecurity framework
    • CIS Controls v8.1 - Security best practices

    Labels for CI/CD and infrastructure:

    Label Color Description
    ci-cd #1565c0 CI/CD pipeline changes
    deployment #0d47a1 Deployment configuration
    performance #ff6f00 Performance optimization
    monitoring #558b2f Monitoring and alerting

    Auto-applies when:

    • Changing .github/workflows/ files
    • Modifying CNAME, robots.txt, vite.config.js
    • PR title starts with ci:, deploy:, perf:, monitoring:

    Labels for code quality and testing:

    Label Color Description
    testing #26c6da Test coverage
    accessibility #7e57c2 WCAG 2.1 AA compliance
    documentation #0075ca Documentation updates
    refactor #ffb74d Code refactoring

    Auto-applies when:

    • Changing files in tests/, cypress/, *.test.js
    • Modifying **/*.md files
    • PR title starts with test:, a11y:, docs:, refactor:

    Essential workflow labels:

    Label Color Description
    bug #d73a4a Bug fixes
    enhancement #a2eeef Enhancements
    dependencies #0366d6 Dependency updates

    Auto-applies when:

    • PR title starts with fix:, bug:, feat:, deps:
    • Changing package.json, package-lock.json
    • PR body contains - [x] ๐Ÿ› Bug Fix, - [x] โœจ Enhancement

    Labels for GitHub Copilot agents and agentic workflows:

    Label Color Description
    agent #5319e7 Agent configuration
    skill #bfd4f2 Skill configuration
    agentic-workflow #6e40aa Agentic workflow changes

    Auto-applies when:

    • Changing .github/agents/, .github/skills/, AGENTS.md, SKILLS.md
    • Modifying .github/workflows/*.md, .github/workflows/*.lock.yml
    • PR title starts with agent:, skill:, aw:

    Manual labels for prioritization:

    Label Color Description
    priority-critical #b60205 Critical priority (security, outages)
    priority-high #d93f0b High priority (important features)
    priority-medium #fbca04 Medium priority (standard work)
    priority-low #0e8a16 Low priority (nice-to-have)

    Usage: Manually add to PRs/issues to indicate urgency.


    Automatically calculated from PR diff:

    Label Color Lines Changed Description
    size-xs #3cbf00 < 10 Extra small change
    size-s #5d9801 10-50 Small change
    size-m #7f7f00 50-250 Medium change
    size-l #bf7e00 250-1000 Large change
    size-xl #d93f0b > 1000 Extra large change

    Auto-applies: Calculated from additions + deletions in PR diff.


    Manual labels for workflow tracking:

    Label Color Description
    status-needs-review #fbca04 Needs code review
    status-in-progress #1d76db Work in progress
    status-blocked #d93f0b Blocked by dependencies
    status-ready #0e8a16 Ready to merge

    Usage: Manually add/update as PR progresses through workflow.


    The automatic labeler is configured in .github/labeler.yml. Labels are applied based on:

    1. File path patterns - Uses glob patterns to match changed files
    2. PR title - Matches title prefixes (e.g., fix:, feat:)
    3. PR body - Matches checkbox patterns (e.g., - [x] ๐Ÿ› Bug Fix)

    Example:

    news:
    - any:
    - changed-files:
    - any-glob-to-any-file:
    - "news/**/*.html"
    - "scripts/article-template.js"
    - title: "news:*"
    - body: "- [x] ๐Ÿ“ฐ News Content"

    To modify the labeling system:

    1. Edit label definitions: Modify .github/workflows/setup-labels.yml
    2. Edit auto-labeling rules: Modify .github/labeler.yml
    3. Run setup workflow: Actions โ†’ Setup Repository Labels
    4. Test on new PR: Create a test PR to verify labels

    Example 1: News Article PR

    Files changed:

    • news/2026-02-15-riksdag-budget-vote-en.html
    • news/2026-02-15-riksdag-budget-vote-sv.html

    Labels applied:

    • โœ… news (news article)
    • โœ… html-css (HTML files)
    • โœ… i18n (multi-language)
    • โœ… translation (Swedish translation)
    • โœ… size-s (< 50 lines)

    Files changed:

    • js/politician-dashboard.js
    • politician-dashboard.html
    • cia-data/politician/view_riksdagen_politician_ranking_sample.csv

    PR Title: feat: Add politician influence network visualization

    Labels applied:

    • โœ… dashboard (dashboard changes)
    • โœ… visualization (data visualization)
    • โœ… javascript (JS code)
    • โœ… html-css (HTML file)
    • โœ… cia-data (CIA data)
    • โœ… enhancement (feature)
    • โœ… size-m (50-250 lines)

    Files changed:

    • SECURITY_ARCHITECTURE.md
    • THREAT_MODEL.md
    • .github/skills/iso-27001-controls/SKILL.md

    PR Title: security: Update ISO 27001 control mapping

    Labels applied:

    • โœ… security (security changes)
    • โœ… isms (ISMS compliance)
    • โœ… iso-27001 (ISO 27001)
    • โœ… documentation (markdown files)
    • โœ… skill (skill changes)
    • โœ… size-m (50-250 lines)

    Files changed:

    • .github/workflows/data-pipeline.yml
    • .github/workflows/quality-checks.yml

    PR Title: ci: Optimize data pipeline workflow

    Labels applied:

    • โœ… workflow (GitHub Actions)
    • โœ… ci-cd (CI/CD changes)
    • โœ… data-pipeline (data pipeline)
    • โœ… performance (optimization)
    • โœ… size-s (< 50 lines)

    Problem: Labels are not being applied to PRs.

    Solutions:

    1. Check if labels exist: Actions โ†’ Setup Repository Labels โ†’ Run workflow
    2. Verify labeler workflow ran: Actions โ†’ Pull Request Automatic Labeler
    3. Check workflow logs for errors
    4. Ensure .github/labeler.yml is valid YAML

    Problem: Some labels don't exist in the repository.

    Solution:

    1. Go to Actions โ†’ Setup Repository Labels
    2. Click "Run workflow"
    3. (Optional) Check "Recreate all labels" to rebuild from scratch
    4. Wait for completion
    5. Re-trigger labeler on existing PRs

    Problem: Size label doesn't match PR diff.

    Explanation: Size is calculated from total changes (additions + deletions), not just additions.

    Formula:

    TOTAL_CHANGES = ADDITIONS + DELETIONS
    if TOTAL_CHANGES < 10: size-xs
    elif TOTAL_CHANGES < 50: size-s
    elif TOTAL_CHANGES < 250: size-m
    elif TOTAL_CHANGES < 1000: size-l
    else: size-xl


    When contributing to the labeling system:

    1. โœ… Test label changes on a test PR first
    2. โœ… Document new labels in this file
    3. โœ… Follow existing color scheme patterns
    4. โœ… Ensure labels align with repository structure
    5. โœ… Update WORKFLOWS.md if adding new workflows

    Last Updated: 2026-02-15
    Version: 1.0
    Maintained by: Hack23 AB (Org.nr 5595347807)


    ๐ŸŒ Platforms ๐Ÿ“ฆ Open-Source Projects ๐Ÿ›ก๏ธ Governance & Standards
    ๐Ÿ—ณ๏ธ Riksdagsmonitor โ€” Swedish Parliament intelligence
    ๐Ÿ‡ช๐Ÿ‡บ EU Parliament Monitor โ€” European coverage
    ๐Ÿ•ต๏ธ Citizen Intelligence Agency โ€” political-data engine
    ๐ŸŒ Hack23 AB โ€” corporate site
    ๐Ÿ“ฐ Hack23 Blog โ€” engineering & policy
    ๐Ÿ’ผ Hack23 on LinkedIn
    ๐Ÿ—ณ๏ธ Hack23/riksdagsmonitor
    ๐Ÿ•ต๏ธ Hack23/cia
    ๐Ÿ‡ช๐Ÿ‡บ Hack23/euparliamentmonitor
    ๐Ÿ”Œ Hack23/european-parliament-mcp
    โœ… Hack23/cia-compliance-manager
    ๐Ÿฅ‹ Hack23/black-trigram
    ๐Ÿ  Hack23/homepage
    ๐Ÿ›ก๏ธ Hack23 ISMS-PUBLIC โ€” public ISMS
    ๐Ÿ”’ Information Security Policy
    ๐Ÿค– AI Policy
    ๐Ÿงช Secure Development Policy
    ๐ŸŽฏ Threat Modeling Policy
    โš ๏ธ Vulnerability Management
    ๐Ÿท๏ธ Classification Framework

    OpenSSF Best Practices OpenSSF Scorecard ISO 27001:2022 NIST CSF 2.0 CIS Controls v8.1 Apache 2.0

    ๐Ÿ—ณ๏ธ Empower citizens ยท ๐Ÿ” Strengthen democratic accountability ยท ๐Ÿ•ต๏ธ Illuminate the political process

    ยฉ 2008โ€“2026 Hack23 AB (Org.nr 559534-7807) ยท Maintainer: James Pether Sรถrling, CISSP CISM