Skip to content
Merged
130 changes: 130 additions & 0 deletions .github/skills/legislative-monitoring/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ Apply this skill when:
- ✅ Detecting legislative obstruction or procedural manipulation
- ✅ Measuring government vs. opposition effectiveness
- ✅ Tracking amendment success rates and strategic positioning
- ✅ Tracking Riksrevisionen (RiR) audit findings and constitutional skrivelse deadlines
- ✅ Monitoring government accountability for audit recommendations
- ✅ Generating overdue-deadline alerts for unanswered RiR reports

Do NOT use for:
- ❌ Manipulating legislative processes through intelligence
Expand Down Expand Up @@ -1105,6 +1108,133 @@ ORDER BY intensity_score DESC, collaboration_count DESC;
| **CIS Control 8 - Audit Log Management** | Legislative activity audit logging |
| **CIS Control 11 - Data Recovery** | Parliamentary data backup and recovery |

## 7. Riksrevisionen (RiR) Follow-Up Tracking

### Constitutional Framework

Swedish constitutional practice (Riksdagsordningen ch. 10 and Government Offices' established conventions) requires the government to formally respond to each Riksrevisionen audit report with a **skrivelse** (written communication to the Riksdag) within **4 calendar months** of the report's publication.

Failure to respond within this deadline is a constitutional accountability gap that creates political risk and potential for opposition interpellations, motions, and media pressure.

### Data Model

The authoritative dataset lives at `data/rir-followups.json` (JSON schema: `schemas/rir-followups-schema.json`). Each record captures:

| Field | Description |
|-------|-------------|
| `rir_report_id` | Riksdag document ID (e.g. `HD01JuU31`) |
| `rir_number` | Official RiR number (e.g. `RiR 2026:6`) |
| `title` / `title_en` | Swedish and English titles |
| `agency` | Primary audited government agency |
| `committees` | Riksdag committee codes (e.g. `JuU`, `FöU`) |
| `publish_date` | ISO 8601 publication date |
| `skrivelse_deadline` | Calculated 4-month constitutional deadline |
| `gov_response_status` | `PENDING` \| `RESPONDED` \| `OVERDUE` \| `PARTIAL` |
| `response_skrivelse_id` | Reference if government has responded |
| `parliamentary_followup_doc_ids` | Related Riksdag documents |
| `open_recommendations` | Count of unresolved audit recommendations |
| `risk_level` | `LOW` \| `MEDIUM` \| `HIGH` \| `CRITICAL` |

### Status Lifecycle

```mermaid
stateDiagram-v2
[*] --> PENDING : RiR report published
PENDING --> RESPONDED : Government delivers skrivelse
PENDING --> OVERDUE : 4-month deadline elapsed, no response
PENDING --> PARTIAL : Government responds partially
OVERDUE --> RESPONDED : Belated skrivelse delivered
PARTIAL --> RESPONDED : Full response delivered
RESPONDED --> [*] : Follow-up complete
```

### Library: `scripts/rir-followups-client.ts`

The `rir-followups-client` module provides all necessary tools:

```typescript
import {
calculateSkrivelseDeadline, // Deadline from publish date (canonical spelling)
deriveResponseStatus, // Re-derive status vs today's date
detectOverdueAlerts, // Scan dataset for overdue records
renderRirFollowUpTable, // Render Markdown table
injectRirTableIntoDocument, // Inject/replace table in a document
filterByCommittee, // Filter by Riksdag committee
filterByStatus, // Filter by response status
filterByMinRiskLevel, // Filter by minimum risk level
validateRirRecord, // Validate a single record
validateRirDataset, // Validate full dataset
loadRirDataset, // Load JSON from file (injectable I/O)
saveRirDataset, // Save JSON to file (injectable I/O)
} from './rir-followups-client.js';
```

### CLI: `scripts/fetch-rir-followups.ts`

Run daily (or as part of the news workflow) to:
1. Fetch recent government skrivelser from `data.riksdagen.se`
2. Match against known RiR follow-up records
3. Update `gov_response_status` and `response_skrivelse_id`
4. Emit overdue alerts (exit code 1 with `--alert` flag)

```bash
# Check for overdue alerts (exit 1 if found)
npx tsx scripts/fetch-rir-followups.ts --alert

# Dry-run against a specific reference date
npx tsx scripts/fetch-rir-followups.ts --dry-run --date 2026-05-01
```

### Injecting RiR Follow-Up Tables into Intelligence Assessments

Every intelligence-assessment document that cites a Riksrevisionen finding **MUST** include a follow-up status table. Use the `injectRirTableIntoDocument` helper or add the HTML markers manually:

```markdown
<!-- RIR-FOLLOWUP-TABLE-START -->

## 🔍 Riksrevisionen Follow-Up Status

| RiR # | Title | Agency | Published | Skrivelse Deadline | Status | Days Overdue |
|-------|-------|--------|-----------|-------------------|--------|--------------|
| RiR 2026:6 | [Polisreform…](https://…) | Polismyndigheten | 2026-01-15 | 2026-05-15 | ⏳ PENDING | — |
| RiR 2025:18 | [Civilt försvar…](https://…) | MSB | 2025-12-10 | 2026-04-10 | 🚨 OVERDUE | ⚠️ 17 |

<!-- RIR-FOLLOWUP-TABLE-END -->
```

### Riksdag API Search for Skrivelser

To fetch government responses manually via the riksdag-regering-mcp tools:

```typescript
// Via search_dokument MCP tool
riksdag-regering-search_dokument({
doktyp: 'skr', // skrivelse (government communication)
from_date: '2025-01-01',
to_date: '2026-12-31',
titel: 'Riksrevisionen' // or specific RiR number
})
```

### Workflow Integration

Wire the RiR follow-up tracker into intelligence-assessment generation by:

1. **Daily fetch**: Run `fetch-rir-followups.ts` before news generation to ensure `data/rir-followups.json` is up to date
2. **Automatic injection**: For any intelligence assessment document citing a RiR finding (detected via `rir_report_id` or `rir_number` keywords), call `injectRirTableIntoDocument` with the filtered relevant records
3. **KJ propagation**: When a record transitions to `OVERDUE`, update all active Key Judgements (KJs) that reference that RiR finding to reflect the accountability gap

### Alert Thresholds

| Days Overdue | Alert Level | Recommended Action |
|--------------|-------------|-------------------|
| 0 | None | Normal monitoring |
| 1–30 | LOW | Note in intelligence assessment |
| 31–90 | MEDIUM | Create GitHub issue, escalate in weekly-review |
| 91+ | HIGH | Create GitHub issue immediately, flag in KJs |

---

## Hack23 ISMS Policy References

This skill implements requirements from:
Expand Down
87 changes: 87 additions & 0 deletions data/rir-followups.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"$schema": "../schemas/rir-followups-schema.json",
"version": "1.0",
"description": "Riksrevisionen (RiR) follow-up tracker — constitutional skrivelse deadlines and government response status",
"last_updated": "2026-04-27",
"constitutional_deadline_months": 4,
"notes": [
"Swedish constitutional and parliamentary practice cites RO 10:4 for Riksdag handling of Riksrevisionen reports, together with RF 5:4 and, in some assessments, RF ch. 13:7 for the government's accountability and follow-up context; this dataset treats those provisions as complementary rather than conflicting bases for the formal skrivelse response expectation.",
"The conventional deadline is 4 calendar months after the RiR report publication date.",
"A skrivelse_deadline of null means the deadline has not yet been confirmed in the dataset.",
"gov_response_status values: PENDING | RESPONDED | OVERDUE | PARTIAL"
],
"records": [
{
"rir_report_id": "HD01JuU31",
"rir_number": "RiR 2026:6",
"title": "Polisreform — granskning av effektivitet och genomförande",
"title_en": "Police reform — audit of efficiency and implementation",
"agency": "Polismyndigheten",
"policy_area": "Justitia och inrikes frågor",
"committees": ["JuU"],
"publish_date": "2026-01-15",
"skrivelse_deadline": "2026-05-15",
"gov_response_status": "PENDING",
"response_skrivelse_id": null,
"parliamentary_followup_doc_ids": ["HD01JuU31"],
"open_recommendations": 9,
"risk_level": "HIGH",
"notes": "9 open recommendations; potential for follow-up RiR investigation before 2026 election. Cited in realtime-pulse 2026-04-26 analysis.",
"riksdag_url": "https://www.riksdagen.se/sv/dokument-och-lagar/dokument/HD01JuU31/"
},
{
"rir_report_id": "HC03206",
"rir_number": "RiR 2025:18",
"title": "Civilt försvar — granskning av beredskapsförmåga",
"title_en": "Civil defence — audit of emergency preparedness capacity",
"agency": "MSB (Myndigheten för samhällsskydd och beredskap)",
"policy_area": "Försvar och säkerhet",
"committees": ["FöU"],
"publish_date": "2025-12-10",
"skrivelse_deadline": "2026-04-10",
"gov_response_status": "OVERDUE",
"response_skrivelse_id": null,
"parliamentary_followup_doc_ids": ["HC03206"],
"open_recommendations": 7,
"risk_level": "HIGH",
"notes": "Deadline elapsed 2026-04-10 without formal government skrivelse response. Cited in weekly-review and motions analysis 2026-04-26.",
"riksdag_url": "https://www.riksdagen.se/sv/dokument-och-lagar/dokument/HC03206/"
},
{
"rir_report_id": "HB01NU20",
"rir_number": "RiR 2025:12",
"title": "Exportfrämjande — granskning av Business Sweden",
"title_en": "Export promotion — audit of Business Sweden",
"agency": "Business Sweden",
"policy_area": "Näringsliv och handel",
"committees": ["NU"],
"publish_date": "2025-09-22",
"skrivelse_deadline": "2026-01-22",
"gov_response_status": "RESPONDED",
"response_skrivelse_id": "Skr. 2025/26:78",
"parliamentary_followup_doc_ids": ["HB01NU20"],
"open_recommendations": 0,
"risk_level": "LOW",
"notes": "Government responded with Skr. 2025/26:78. Recommendations accepted in full.",
"riksdag_url": "https://www.riksdagen.se/sv/dokument-och-lagar/dokument/HB01NU20/"
},
{
"rir_report_id": "HA01AU15",
"rir_number": "RiR 2025:7",
"title": "Arbetsmarknadspolitiken — granskning av Arbetsförmedlingens matchningsuppdrag",
"title_en": "Labour market policy — audit of Arbetsförmedlingen matching assignment",
"agency": "Arbetsförmedlingen",
"policy_area": "Arbetsmarknad",
"committees": ["AU"],
"publish_date": "2025-06-05",
"skrivelse_deadline": "2025-10-05",
"gov_response_status": "PARTIAL",
"response_skrivelse_id": "Skr. 2025/26:22",
"parliamentary_followup_doc_ids": ["HA01AU15"],
"open_recommendations": 2,
"risk_level": "MEDIUM",
"notes": "Government responded but left 2 recommendations partially unaddressed; follow-up audit possible.",
"riksdag_url": "https://www.riksdagen.se/sv/dokument-och-lagar/dokument/HA01AU15/"
}
]
}
Loading
Loading