Skip to content

Commit ecfe0aa

Browse files
authored
Merge pull request #2040 from Hack23/copilot/add-riksrevisionen-tracker
feat: Riksrevisionen follow-up tracker with skrivelse deadlines and accountability monitoring
2 parents 2c7719a + ab9fc42 commit ecfe0aa

7 files changed

Lines changed: 1990 additions & 0 deletions

File tree

.github/skills/legislative-monitoring/SKILL.md

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ Apply this skill when:
2828
- ✅ Detecting legislative obstruction or procedural manipulation
2929
- ✅ Measuring government vs. opposition effectiveness
3030
- ✅ Tracking amendment success rates and strategic positioning
31+
- ✅ Tracking Riksrevisionen (RiR) audit findings and constitutional skrivelse deadlines
32+
- ✅ Monitoring government accountability for audit recommendations
33+
- ✅ Generating overdue-deadline alerts for unanswered RiR reports
3134

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

1111+
## 7. Riksrevisionen (RiR) Follow-Up Tracking
1112+
1113+
### Constitutional Framework
1114+
1115+
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.
1116+
1117+
Failure to respond within this deadline is a constitutional accountability gap that creates political risk and potential for opposition interpellations, motions, and media pressure.
1118+
1119+
### Data Model
1120+
1121+
The authoritative dataset lives at `data/rir-followups.json` (JSON schema: `schemas/rir-followups-schema.json`). Each record captures:
1122+
1123+
| Field | Description |
1124+
|-------|-------------|
1125+
| `rir_report_id` | Riksdag document ID (e.g. `HD01JuU31`) |
1126+
| `rir_number` | Official RiR number (e.g. `RiR 2026:6`) |
1127+
| `title` / `title_en` | Swedish and English titles |
1128+
| `agency` | Primary audited government agency |
1129+
| `committees` | Riksdag committee codes (e.g. `JuU`, `FöU`) |
1130+
| `publish_date` | ISO 8601 publication date |
1131+
| `skrivelse_deadline` | Calculated 4-month constitutional deadline |
1132+
| `gov_response_status` | `PENDING` \| `RESPONDED` \| `OVERDUE` \| `PARTIAL` |
1133+
| `response_skrivelse_id` | Reference if government has responded |
1134+
| `parliamentary_followup_doc_ids` | Related Riksdag documents |
1135+
| `open_recommendations` | Count of unresolved audit recommendations |
1136+
| `risk_level` | `LOW` \| `MEDIUM` \| `HIGH` \| `CRITICAL` |
1137+
1138+
### Status Lifecycle
1139+
1140+
```mermaid
1141+
stateDiagram-v2
1142+
[*] --> PENDING : RiR report published
1143+
PENDING --> RESPONDED : Government delivers skrivelse
1144+
PENDING --> OVERDUE : 4-month deadline elapsed, no response
1145+
PENDING --> PARTIAL : Government responds partially
1146+
OVERDUE --> RESPONDED : Belated skrivelse delivered
1147+
PARTIAL --> RESPONDED : Full response delivered
1148+
RESPONDED --> [*] : Follow-up complete
1149+
```
1150+
1151+
### Library: `scripts/rir-followups-client.ts`
1152+
1153+
The `rir-followups-client` module provides all necessary tools:
1154+
1155+
```typescript
1156+
import {
1157+
calculateSkrivelseDeadline, // Deadline from publish date (canonical spelling)
1158+
deriveResponseStatus, // Re-derive status vs today's date
1159+
detectOverdueAlerts, // Scan dataset for overdue records
1160+
renderRirFollowUpTable, // Render Markdown table
1161+
injectRirTableIntoDocument, // Inject/replace table in a document
1162+
filterByCommittee, // Filter by Riksdag committee
1163+
filterByStatus, // Filter by response status
1164+
filterByMinRiskLevel, // Filter by minimum risk level
1165+
validateRirRecord, // Validate a single record
1166+
validateRirDataset, // Validate full dataset
1167+
loadRirDataset, // Load JSON from file (injectable I/O)
1168+
saveRirDataset, // Save JSON to file (injectable I/O)
1169+
} from './rir-followups-client.js';
1170+
```
1171+
1172+
### CLI: `scripts/fetch-rir-followups.ts`
1173+
1174+
Run daily (or as part of the news workflow) to:
1175+
1. Fetch recent government skrivelser from `data.riksdagen.se`
1176+
2. Match against known RiR follow-up records
1177+
3. Update `gov_response_status` and `response_skrivelse_id`
1178+
4. Emit overdue alerts (exit code 1 with `--alert` flag)
1179+
1180+
```bash
1181+
# Check for overdue alerts (exit 1 if found)
1182+
npx tsx scripts/fetch-rir-followups.ts --alert
1183+
1184+
# Dry-run against a specific reference date
1185+
npx tsx scripts/fetch-rir-followups.ts --dry-run --date 2026-05-01
1186+
```
1187+
1188+
### Injecting RiR Follow-Up Tables into Intelligence Assessments
1189+
1190+
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:
1191+
1192+
```markdown
1193+
<!-- RIR-FOLLOWUP-TABLE-START -->
1194+
1195+
## 🔍 Riksrevisionen Follow-Up Status
1196+
1197+
| RiR # | Title | Agency | Published | Skrivelse Deadline | Status | Days Overdue |
1198+
|-------|-------|--------|-----------|-------------------|--------|--------------|
1199+
| RiR 2026:6 | [Polisreform…](https://…) | Polismyndigheten | 2026-01-15 | 2026-05-15 | ⏳ PENDING ||
1200+
| RiR 2025:18 | [Civilt försvar…](https://…) | MSB | 2025-12-10 | 2026-04-10 | 🚨 OVERDUE | ⚠️ 17 |
1201+
1202+
<!-- RIR-FOLLOWUP-TABLE-END -->
1203+
```
1204+
1205+
### Riksdag API Search for Skrivelser
1206+
1207+
To fetch government responses manually via the riksdag-regering-mcp tools:
1208+
1209+
```typescript
1210+
// Via search_dokument MCP tool
1211+
riksdag-regering-search_dokument({
1212+
doktyp: 'skr', // skrivelse (government communication)
1213+
from_date: '2025-01-01',
1214+
to_date: '2026-12-31',
1215+
titel: 'Riksrevisionen' // or specific RiR number
1216+
})
1217+
```
1218+
1219+
### Workflow Integration
1220+
1221+
Wire the RiR follow-up tracker into intelligence-assessment generation by:
1222+
1223+
1. **Daily fetch**: Run `fetch-rir-followups.ts` before news generation to ensure `data/rir-followups.json` is up to date
1224+
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
1225+
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
1226+
1227+
### Alert Thresholds
1228+
1229+
| Days Overdue | Alert Level | Recommended Action |
1230+
|--------------|-------------|-------------------|
1231+
| 0 | None | Normal monitoring |
1232+
| 1–30 | LOW | Note in intelligence assessment |
1233+
| 31–90 | MEDIUM | Create GitHub issue, escalate in weekly-review |
1234+
| 91+ | HIGH | Create GitHub issue immediately, flag in KJs |
1235+
1236+
---
1237+
11081238
## Hack23 ISMS Policy References
11091239

11101240
This skill implements requirements from:

data/rir-followups.json

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
{
2+
"$schema": "../schemas/rir-followups-schema.json",
3+
"version": "1.0",
4+
"description": "Riksrevisionen (RiR) follow-up tracker — constitutional skrivelse deadlines and government response status",
5+
"last_updated": "2026-04-27",
6+
"constitutional_deadline_months": 4,
7+
"notes": [
8+
"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.",
9+
"The conventional deadline is 4 calendar months after the RiR report publication date.",
10+
"A skrivelse_deadline of null means the deadline has not yet been confirmed in the dataset.",
11+
"gov_response_status values: PENDING | RESPONDED | OVERDUE | PARTIAL"
12+
],
13+
"records": [
14+
{
15+
"rir_report_id": "HD01JuU31",
16+
"rir_number": "RiR 2026:6",
17+
"title": "Polisreform — granskning av effektivitet och genomförande",
18+
"title_en": "Police reform — audit of efficiency and implementation",
19+
"agency": "Polismyndigheten",
20+
"policy_area": "Justitia och inrikes frågor",
21+
"committees": ["JuU"],
22+
"publish_date": "2026-01-15",
23+
"skrivelse_deadline": "2026-05-15",
24+
"gov_response_status": "PENDING",
25+
"response_skrivelse_id": null,
26+
"parliamentary_followup_doc_ids": ["HD01JuU31"],
27+
"open_recommendations": 9,
28+
"risk_level": "HIGH",
29+
"notes": "9 open recommendations; potential for follow-up RiR investigation before 2026 election. Cited in realtime-pulse 2026-04-26 analysis.",
30+
"riksdag_url": "https://www.riksdagen.se/sv/dokument-och-lagar/dokument/HD01JuU31/"
31+
},
32+
{
33+
"rir_report_id": "HC03206",
34+
"rir_number": "RiR 2025:18",
35+
"title": "Civilt försvar — granskning av beredskapsförmåga",
36+
"title_en": "Civil defence — audit of emergency preparedness capacity",
37+
"agency": "MSB (Myndigheten för samhällsskydd och beredskap)",
38+
"policy_area": "Försvar och säkerhet",
39+
"committees": ["FöU"],
40+
"publish_date": "2025-12-10",
41+
"skrivelse_deadline": "2026-04-10",
42+
"gov_response_status": "OVERDUE",
43+
"response_skrivelse_id": null,
44+
"parliamentary_followup_doc_ids": ["HC03206"],
45+
"open_recommendations": 7,
46+
"risk_level": "HIGH",
47+
"notes": "Deadline elapsed 2026-04-10 without formal government skrivelse response. Cited in weekly-review and motions analysis 2026-04-26.",
48+
"riksdag_url": "https://www.riksdagen.se/sv/dokument-och-lagar/dokument/HC03206/"
49+
},
50+
{
51+
"rir_report_id": "HB01NU20",
52+
"rir_number": "RiR 2025:12",
53+
"title": "Exportfrämjande — granskning av Business Sweden",
54+
"title_en": "Export promotion — audit of Business Sweden",
55+
"agency": "Business Sweden",
56+
"policy_area": "Näringsliv och handel",
57+
"committees": ["NU"],
58+
"publish_date": "2025-09-22",
59+
"skrivelse_deadline": "2026-01-22",
60+
"gov_response_status": "RESPONDED",
61+
"response_skrivelse_id": "Skr. 2025/26:78",
62+
"parliamentary_followup_doc_ids": ["HB01NU20"],
63+
"open_recommendations": 0,
64+
"risk_level": "LOW",
65+
"notes": "Government responded with Skr. 2025/26:78. Recommendations accepted in full.",
66+
"riksdag_url": "https://www.riksdagen.se/sv/dokument-och-lagar/dokument/HB01NU20/"
67+
},
68+
{
69+
"rir_report_id": "HA01AU15",
70+
"rir_number": "RiR 2025:7",
71+
"title": "Arbetsmarknadspolitiken — granskning av Arbetsförmedlingens matchningsuppdrag",
72+
"title_en": "Labour market policy — audit of Arbetsförmedlingen matching assignment",
73+
"agency": "Arbetsförmedlingen",
74+
"policy_area": "Arbetsmarknad",
75+
"committees": ["AU"],
76+
"publish_date": "2025-06-05",
77+
"skrivelse_deadline": "2025-10-05",
78+
"gov_response_status": "PARTIAL",
79+
"response_skrivelse_id": "Skr. 2025/26:22",
80+
"parliamentary_followup_doc_ids": ["HA01AU15"],
81+
"open_recommendations": 2,
82+
"risk_level": "MEDIUM",
83+
"notes": "Government responded but left 2 recommendations partially unaddressed; follow-up audit possible.",
84+
"riksdag_url": "https://www.riksdagen.se/sv/dokument-och-lagar/dokument/HA01AU15/"
85+
}
86+
]
87+
}

0 commit comments

Comments
 (0)