fixes: immunity outcomes without political connection, ORF fee rows, dropped WKStA investigations

- parlament.items (parser 3): a committee finding of no connection to the political activity
  (Art. 57 Abs. 3 B-VG) means prosecution may proceed; it was left at 'requested'. Authority and
  case number no longer run into the following sentence on older reports.
- rtr.medientransparenz (parser 2): notice type 31 is the ORF's licence-fee income under section 31
  ORF-G, not a payment to an organisation named after the paragraph.
- enrich.legal: 'Einstellung der Ermittlungen' is proceedings_dropped, not an investigation.
- reparse -p kinds=a,b replays only responses of these request kinds (no stale sweep then).
- migration 0010 removes the wrong ORF rows and organisations and re-queues the affected headlines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
simonandClaude Opus 5.5 committed 2026-11-20 10:03:11 +01:00
1 parent d2039a9dc3
commit f2d72fe464
8 files changed
+130 -7

No files matched your search

+6 -1
View File
@@ -155,6 +155,11 @@ def _reparse(adapter: Adapter, ctx: RunContext, conn: Connection) -> None:
loader = Loader(conn, ctx)
started = conn.execute("SELECT now() AS t").fetchone()["t"]
rows = archive.latest_stored(conn, adapter.name)
# -p kinds=a,b reparses only responses of these request kinds (e.g. one parser of a large adapter). Claims
# of the other kinds are not reproduced then, so the stale-claim sweep is skipped.
kinds = {k for k in str(ctx.params.get("kinds", "")).split(",") if k}
if kinds:
rows = [r for r in rows if (r["request"] or {}).get("kind", "default") in kinds]
ctx.log.info("reparsing %s archived responses", len(rows))
# Parse list/index responses before detail responses: records referencing others (vote positions ->
# vote events) are emitted by the parent's parse() in order, so the original order is preserved
@@ -173,7 +178,7 @@ def _reparse(adapter: Adapter, ctx: RunContext, conn: Connection) -> None:
tdm_reserved=row["tdm_reserved"], from_archive=True)
ctx.stats["responses"] += 1
_parse_and_load(adapter, ctx, conn, loader, resp) # follow-ups are archived separately
if not ctx.stats.get("errors") and not ctx.stats.get("missing_blobs"):
if not kinds and not ctx.stats.get("errors") and not ctx.stats.get("missing_blobs"):
_sweep_stale_claims(adapter, ctx, conn, started)
+3 -1
View File
@@ -26,7 +26,9 @@ STAGES = [
r"schuldig gesprochen|Schuldspruch|\bverurteilt\b)", re.I)),
("acquitted", re.compile(r"\b(freigesprochen|Freispruch)\b", re.I)),
("diversion", re.compile(r"\bDiversion\b", re.I)),
("proceedings_dropped", re.compile(r"\b(Verfahren|Ermittlungen)\b.*\beingestellt\b|\beingestellt\b.*\bVerfahren\b", re.I)),
# "Einstellung(en) der Ermittlungen gegen ..." as well as "Verfahren eingestellt"
("proceedings_dropped", re.compile(r"\b(Verfahren|Ermittlungen)\b.*\beingestellt\b|\beingestellt\b.*\bVerfahren\b|"
r"\bEinstellung(en)?\b.{0,40}\b(Verfahrens?|Ermittlung(en|sverfahren)?)\b", re.I)),
("trial", re.compile(r"\b(Prozess|Strafprozess|vor Gericht|Prozessauftakt|Hauptverhandlung)\b", re.I)),
("indicted", re.compile(r"\b(angeklagt|Anklage|Strafantrag)\b", re.I)),
("investigation", re.compile(r"\b(ermittelt|Ermittlungen|Ermittlungsverfahren|Beschuldigte[rn]?|Hausdurchsuchung|"
@@ -170,8 +170,9 @@ STGB_OFFENSES = {
def parse_immunity_report(text: str) -> dict[str, Any]:
authority = re.search(r"Ersuchen (?:der|des) (.+?),\s*(?:do\.|GZ|Zl)", text)
case_ref = re.search(r"\bGZ\.?\s*([^,]+?),", text)
# "Ersuchen der Staatsanwaltschaft Wien, do. GZ. 501 St 68/24k, um ..." or "... Wien (GZ 25 St 407/08i) um ..."
authority = re.search(r"Ersuchen (?:der|des) ([^,()]{3,90}?)\s*(?:,|\(|\bum\b)", text)
case_ref = re.search(r"\b(?:GZ|Zl)\.?:?\s*([^,()]{3,60}?)\s*[,)]", text)
# "wegen des Verdachtes einer strafbaren Handlung nach § 283 Abs. 1 Z 1 und Z 2, Abs. 2 StGB"
offense = re.search(r"wegen[^§]{0,90}?(§§? ?\d+.{0,120}?\b(?:StGB|VerbotsG|FinStrG|[A-Z][A-Za-z]*G)\b)", text)
offense_text = offense.group(1).strip() if offense else None
@@ -183,12 +184,16 @@ def parse_immunity_report(text: str) -> dict[str, Any]:
recommendation = None
if decision:
recommendation = "refuse" if (decision.group(1) or decision.group(2)) else "consent"
elif re.search(r"festgestellt, dass kein Zusammenhang", text):
# Art. 57 Abs. 3 B-VG: without a connection to the political activity, immunity does not apply and the
# authority may prosecute without the Nationalrat's consent.
recommendation = "no_connection"
connection = None
if re.search(r"\bkein Zusammenhang\b", text):
connection = False
elif re.search(r"\bein Zusammenhang\b", text):
connection = True
quote = re.search(r"Als Ergebnis seiner Beratungen.*?(?:zugestimmt|nicht zugestimmt)\s*\.", text)
quote = re.search(r"Als Ergebnis seiner Beratungen.*?(?:zugestimmt|kein Zusammenhang\b.{0,300}?\bbesteht)\s*\.", text)
return {
"authority": authority.group(1).strip() if authority else None,
"case_ref": case_ref.group(1).strip() if case_ref else None,
+13 -2
View File
@@ -56,7 +56,7 @@ class ParlamentItems(Adapter):
name = "parlament.items"
description = "Votes (faction + roll call), immunity requests, written questions, U-committee hearings"
schedule = "45 3 * * *"
parser_version = 2
parser_version = 3 # 3: immunity reports finding no political connection, cleaner authority and case number
def start(self, ctx: RunContext) -> Iterator[Request]:
for gp in ctx.params.get("periods") or get_settings().parlament_periods:
@@ -232,12 +232,23 @@ class ParlamentItems(Adapter):
name = re.sub(r"^.*?(Abgeordneten zum Nationalrat|Mitglied(es)? des Bundesrates)\s*(Klubobmann|Klubobfrau)?",
"", title).strip()
decided = str(meta.get("status")) == "5"
recommendation = details["recommendation"] or ""
stage = {"consent": "immunity_waived" if decided else "immunity_waiver_requested",
"no_connection": "immunity_waived" if decided else "immunity_waiver_requested",
"refuse": "immunity_refused" if decided else "immunity_waiver_requested"}.get(
details["recommendation"] or "", "immunity_waiver_requested")
recommendation, "immunity_waiver_requested")
stage_de = {"immunity_waived": "Nationalrat stimmte der behördlichen Verfolgung zu (Immunität aufgehoben)",
"immunity_refused": "Nationalrat verweigerte die Zustimmung zur behördlichen Verfolgung",
"immunity_waiver_requested": "Ersuchen um Aufhebung der Immunität"}[stage]
if recommendation == "no_connection":
# Art. 57 Abs. 3 B-VG: no connection to the political activity -> no immunity, prosecution may proceed.
stage_de = ("Nationalrat stellte fest: kein Zusammenhang mit der politischen Tätigkeit, behördliche "
"Verfolgung zulässig" if decided else
"Ersuchen um Zustimmung zur behördlichen Verfolgung (Ausschuss empfiehlt: kein Zusammenhang "
"mit der politischen Tätigkeit, Verfolgung zulässig)")
elif stage == "immunity_waiver_requested" and recommendation:
stage_de += {"consent": " (Ausschuss empfiehlt Zustimmung)",
"refuse": " (Ausschuss empfiehlt, nicht zuzustimmen)"}[recommendation]
offense = details["offense"]
requested = parse_date(meta.get("date"))
yield Claim(
+25
View File
@@ -33,6 +33,9 @@ SPEC = SourceSpec(
"no use for defamatory/discriminatory purposes.",
)
KIND = {2: "government_ad", 4: "subsidy"}
# Notice type 31 (until 2023): the ORF reports what it received under § 31 ORF-G (licence fee "Programmentgelt",
# compensation under Abs. 11). The "medium" column then holds the legal basis, not a recipient.
ORF_FEE_REPORT = 31
def half_years(since_year: int) -> list[str]:
@@ -52,6 +55,7 @@ class MediaTransparency(Adapter):
description = "Government advertising and media subsidies per public body and media owner"
schedule = "0 4 * * 2"
queue = "bulk"
parser_version = 2 # 2: § 31 ORF-G fee reports are the ORF's income, not payments to a medium
def start(self, ctx: RunContext) -> Iterator[Request]:
for period in half_years(int(ctx.params.get("since_year", 2024))):
@@ -61,6 +65,23 @@ class MediaTransparency(Adapter):
yield Request(url=f"{API}/mt-bekanntgabe.json", params={"quartal": period, "size": PAGE_SIZE, "page": 0},
kind="quartal", meta={"period": period})
@staticmethod
def orf_fee(row: dict[str, Any], amount: float, label: str, period: str) -> Claim:
orf_name = (row.get("rechtstraeger") or "Österreichischer Rundfunk").strip().strip('"')
basis = (row.get("mediumMedieninhaber") or row.get("medium") or "§ 31 ORF-G").strip()
orf = OrgRef(name=orf_name, kind="media")
return Claim(
claim_type="money_flow", org=orf,
summary_de=f"{orf_name}: Einnahmen aus {basis}, {format_eur_de(amount)} € ({label})",
summary_en=f"{orf_name}: income under {basis} (licence fee), EUR {amount:,.2f} ({label})",
data={"legal_basis": basis, "period": label},
evidence=[Evidence(url=f"{API}/mt-bekanntgabe.json?quartal={period}", doc_type="dataset_row",
title=f"Medientransparenz {label}: {orf_name}", quote=f"{orf_name}: {basis}: {amount} €")],
topics=("Information und Medien",),
facet=Money(kind="other", amount=amount, payee=orf, payee_name=orf_name, payer_name=basis, period=label,
reference=basis, category="orf_fee"),
)
def parse(self, ctx: RunContext, response: Response) -> Iterator[Any]:
rows = response.json().get("data") or []
params = response.request.params or {}
@@ -74,6 +95,10 @@ class MediaTransparency(Adapter):
amount = row.get("euro")
if row.get("leermeldung") or amount is None or float(amount) < min_euro:
continue
if row.get("bekanntgabe") == ORF_FEE_REPORT:
if float(amount) > 0:
yield self.orf_fee(row, float(amount), label, period)
continue
kind = KIND.get(row.get("bekanntgabe"), "other")
payer_name = (row.get("rechtstraeger") or "").strip().strip('"')
owner = (row.get("medieninhaber") or row.get("mediumMedieninhaber") or "").strip()