LABELS.md

May 3, 2026 Β· View on GitHub

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.


πŸ“‹ Overview

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.

Key Features

  • βœ… 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.


πŸš€ Setup

Initial Setup

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

Automatic Labeling

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

🏷️ Label Categories

πŸ—³οΈ Content & Features

Labels for content generation and feature development:

LabelColorDescription
news#ff6b9dNews articles and content generation
dashboard#1e88e5Interactive dashboards (Chart.js/D3.js)
visualization#9c27b0Data visualization features
intelligence#6a1b9aPolitical 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

πŸ’» Technology

Labels for technical implementation:

LabelColorDescription
html-css#e1bee7HTML/CSS changes
javascript#f9a825JavaScript code changes
workflow#1976d2GitHub Actions workflows
security#d32f2fSecurity improvements

Auto-applies when:

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

πŸ“Š Data Integration

Labels for data pipeline and integration:

LabelColorDescription
cia-data#00897bCIA platform data integration
riksdag-data#0277bdRiksdag-Regering MCP data
data-pipeline#00695cETL and data processing
schema#546e7aData 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:

🌍 Internationalization

Labels for multi-language support (14 languages):

LabelColorDescription
i18n#4caf50Internationalization/localization
translation#66bb6aTranslation updates
rtl#8bc34aRTL 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)

πŸ”’ ISMS & Compliance

Labels for security and compliance frameworks:

LabelColorDescription
isms#b71c1cISMS compliance changes
iso-27001#c62828ISO 27001 controls
nist-csf#d32f2fNIST CSF compliance
cis-controls#e53935CIS 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

πŸ—οΈ Infrastructure & Operations

Labels for CI/CD and infrastructure:

LabelColorDescription
ci-cd#1565c0CI/CD pipeline changes
deployment#0d47a1Deployment configuration
performance#ff6f00Performance optimization
monitoring#558b2fMonitoring and alerting

Auto-applies when:

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

πŸ”„ Quality & Testing

Labels for code quality and testing:

LabelColorDescription
testing#26c6daTest coverage
accessibility#7e57c2WCAG 2.1 AA compliance
documentation#0075caDocumentation updates
refactor#ffb74dCode refactoring

Auto-applies when:

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

🏷️ Standard Labels

Essential workflow labels:

LabelColorDescription
bug#d73a4aBug fixes
enhancement#a2eeefEnhancements
dependencies#0366d6Dependency 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

πŸ€– AI & Automation

Labels for GitHub Copilot agents and agentic workflows:

LabelColorDescription
agent#5319e7Agent configuration
skill#bfd4f2Skill configuration
agentic-workflow#6e40aaAgentic 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:

🚦 Priority Labels

Manual labels for prioritization:

LabelColorDescription
priority-critical#b60205Critical priority (security, outages)
priority-high#d93f0bHigh priority (important features)
priority-medium#fbca04Medium priority (standard work)
priority-low#0e8a16Low priority (nice-to-have)

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


πŸ“ Size Labels

Automatically calculated from PR diff:

LabelColorLines ChangedDescription
size-xs#3cbf00< 10Extra small change
size-s#5d980110-50Small change
size-m#7f7f0050-250Medium change
size-l#bf7e00250-1000Large change
size-xl#d93f0b> 1000Extra large change

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


🎭 Status Labels

Manual labels for workflow tracking:

LabelColorDescription
status-needs-review#fbca04Needs code review
status-in-progress#1d76dbWork in progress
status-blocked#d93f0bBlocked by dependencies
status-ready#0e8a16Ready to merge

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


πŸ”§ Configuration

Labeler Configuration

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"

Modifying Labels

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

πŸ“Š Usage Examples

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)

Example 2: Dashboard Enhancement

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)

Example 3: Security Architecture Update

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)

Example 4: CI/CD Workflow

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)

πŸ› οΈ Troubleshooting

Labels Not Applied

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

Missing Labels

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

Size Label Incorrect

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

πŸ“š References


🀝 Contributing

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)


πŸ”— Hack23 Ecosystem

🌐 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