Skip to content

Rewrite Grundsicherung im Alter (Kapitel 4, SGB XII)#1156

Open
MImmesberger wants to merge 18 commits into
mainfrom
gsia-rewrite
Open

Rewrite Grundsicherung im Alter (Kapitel 4, SGB XII)#1156
MImmesberger wants to merge 18 commits into
mainfrom
gsia-rewrite

Conversation

@MImmesberger
Copy link
Copy Markdown
Member

This PR collects the changes made to Grundsicherung im Alter.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 20, 2026

Codecov Report

❌ Patch coverage is 98.89503% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/gettsim/germany/ids.py 89.47% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

MImmesberger and others added 4 commits March 21, 2026 09:32
## Summary

- Update `parameter_vermögensfreibetrag` to 10,000 EUR per person from
2023-01-01 (§1 DurchführungsVO zu §90 Abs. 2 Nr. 9 SGB XII, amended by
Art. 9 Bürgergeld-Gesetz)
- Add test case verifying wealth above the new threshold denies benefits

Closes #1150

## Test plan

- [x] `pixi run ty` and `pixi run ty-jax` pass
- [x] `pixi run prek run --all-files` pass
- [x] Full test suite passes (`pixi run -e py314-jax tests -n 7`)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…1154)

## Summary

- The Freibetrag for zusätzliche Altersvorsorge (§82 Abs. 4/5 SGB XII)
was incorrectly applied from 2011. It was introduced by the
Betriebsrentenstärkungsgesetz (BGBl. I 2017, S. 3214), effective
**2018-01-01**.
- Berufsständische Versorgungswerke (§6 Abs. 1 SGB VI) were incorrectly
included in the Freibetrag. They are first-pillar Pflichtversicherung,
fail the "auf freiwilliger Grundlage" criterion in §82 Abs. 5 Satz 1,
and are explicitly listed as the baseline against which "zusätzliche
Altersvorsorge" is measured.
- The YAML parameter date was wrong (2005 → 2018) and the parameter has
been renamed from `anrechnungsfreier_anteil_private_renteneinkünfte` to
`anrechnungsfreier_anteil_zusätzliche_altersvorsorge` to match the legal
term.
- The GRV Freibetrag for Grundrentenbezieher was written up in a
confusing way; fixed that.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
## Summary

- Adds `eg_id` (Einsatzgemeinschaft) group for SGB XII, which includes
the couple plus their minor unmarried children (< 18) in the same
household (§ 27 Abs. 2 SGB XII)
- Switches Grundsicherung im Alter from `_bg` to `_eg` aggregation,
fixing incorrect benefit computation for households with minor children
- Fixes `vermögensfreibetrag` bug: was using `_fg`
(Familiengemeinschaft) counts instead of the correct group-level counts
- Moves `p_id_lebenspartner` (formerly `p_id_einstandspartner`) from
`arbeitslosengeld_2`/`bürgergeld` namespaces to `familie` (shared across
SGB II and SGB XII), collapsing date-split `fg_id` function into single
functions
- Renames `Einstandspartner` → `Lebenspartner` (`p_id_einstandspartner`
→ `p_id_lebenspartner`)

## Test plan

- [x] `pixi run ty` and `pixi run ty-jax` pass
- [x] `pixi run prek run --all-files` passes
- [x] `pixi run -e py314-jax tests -n 7` — 1285 passed, 528 skipped
- [x] Grouping tests verify correct `eg_id` values for various household
compositions
- [x] `skip_hh_id_25.yaml` (parent + child) needs expected values
recomputed with EG grouping — follow-up needed
- [x] Additional test cases with minor children should be added

Closes #1147
Supersedes #738
Related to #696

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
MImmesberger added a commit to ttsim-dev/gettsim-personas that referenced this pull request Apr 24, 2026
### What problem do you want to solve?

See GETTSIM [#1170](ttsim-dev/gettsim#1170)

(This should be merged before #32, [GETTSIM
#1170](ttsim-dev/gettsim#1170) and [GETTSIM
#1156](ttsim-dev/gettsim#1156))

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
MImmesberger and others added 3 commits April 24, 2026 11:29
…fix module)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
### What problem do you want to solve?

Closes #1157 and #1146 

Note: Some of the regression tests changed their expected outputs. I
carefully checked each of them; and all of them perform better now. Main
reason is that people are not eligible anymore after implementing the
real eligibility check.

**ToDo**
- [x] Update GSiA tests to 2025 using calculator
- [x] Remove condition in Wohngeld

(This should be merged before #1156 before parts of this are already in
there)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Hans-Martin von Gaudecker <hmgaudecker@gmail.com>
# Conflicts:
#	CHANGES.md
#	docs/tt_explanations/index.md
#	src/gettsim/germany/grundsicherung/im_alter/einkommen.py
#	src/gettsim/tests_germany/policy_cases/grundsicherung/im_alter/2023-07-01/vermögen_über_freibetrag.yaml
MImmesberger and others added 4 commits June 7, 2026 13:59
…,000 € or more (§ 43 Abs. 5 SGB XII, 2005–2019) (#1167)

## Summary

- Implement the 100k children exclusion per § 43 Abs. 5 SGB XII
(originally Abs. 2, BGBl. I 2003 S. 3022) for policy dates
**2005–2019**: applicants are excluded from Grundsicherung im Alter if
any first-degree descendant has an annual Gesamteinkommen (§ 16 SGB IV)
of 100,000 EUR or more. The threshold applies to each child
individually.
- The Angehörigen-Entlastungsgesetz (BGBl. I 2019 S. 2135) repealed the
exclusion as of 2020-01-01. Since then the 100,000 EUR limit only
restricts the Unterhaltsrückgriff of the Sozialhilfeträger against the
children (§ 94 Abs. 1a SGB XII), which does not affect the benefit —
`betrag_m` therefore no longer depends on children's income from 2020
on.
- Add `einkommensgrenze_kinder` YAML parameter (100,000 EUR/year,
2005–2019, expired with a note on the repeal).
- New policy functions:
`hat_gesamteinkommen_über_kindeseinkommensgrenze`,
`hat_kind_mit_einkommen_über_einkommensgrenze_als_elternteil_1/_2`
(`AggType.ANY` aggregations over both `p_id_elternteil_*` slots), and
`hat_kind_mit_einkommen_über_einkommensgrenze`.
- Gate `betrag_m` on the new check until 2019; separate `betrag_m`
variant from 2020 on.
- Add a documentation page explaining both regimes
(`docs/tt_explanations/childrens_income_grundsicherung_im_alter.md`).
- Policy cases for the exclusion live at 2018-07-01 (pre-repeal).
- Bump ttsim-backend to current main for the `any_by_p_id` aggregation.

Closes #1148

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Hans-Martin von Gaudecker <hmgaudecker@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Income for Wohngeld so far ignored the § 17a WoGG allowance for
recipients of public pensions with at least 33 years of
Grundrentenzeiten (introduced by Art. 4 Grundrentengesetz, effective
2021-01-01). The deduction is identical in formula to § 82a SGB XII: 100
€ base plus 30 % of pension income above 100 €, capped at 50 % of
Regelbedarfsstufe 1.

Adds the parameter `anrechnungsfreier_anteil_gesetzliche_rente` to
wohngeld/einkommen.yaml and a new `freibetrag_m_ab_2021` policy
function; the prior `freibetrag_m_ab_2016` is retained as
`freibetrag_m_2016_2020`.

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Hans-Martin von Gaudecker <hmgaudecker@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
MImmesberger and others added 3 commits June 7, 2026 17:57
The personas need the new inputs required by the GSIA rewrite
(schwerbehindert_grad_g, grundrentenzeiten_monate, pre-2011 GSIA inputs).
Revert to main once ttsim-dev/gettsim-personas#42 is merged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The personas now provide grundsicherung__im_alter__überschusseinkommen_m_eg = 0
in the grundsicherung_für_erwerbsfähige personas instead of supplying the
inputs of the GSIA subtree (ttsim-dev/gettsim-personas#42).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants