Skip to content

feat(atemschutz): Strahlenschutzüberwachung for a Strahlenschutztrupp - #997

Open
ChrArlt wants to merge 1 commit into
feat/csa-trupp-numberfrom
feat/strahlenschutz-trupp
Open

ChrArlt wants to merge 1 commit into
feat/csa-trupp-numberfrom
feat/strahlenschutz-trupp

Conversation

@ChrArlt

@ChrArlt ChrArlt commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #994. Stacked on #996 (both change the Trupp-Typ). Merge #996 first; this PR then retargets to main.

What changes

A Trupp-Typ can be marked Strahlenschutz in the Stammdaten. The Trupp copies the flag when it is registered, following the copy-at-use rule in AGENTS.md. Every Einsatzkraft in it then carries a record:

  • the numbers of OSL-Dosimeter, Alarmdosimeter, Maske and PA;
  • the Alarmdosimeter Ablesewert, as a value plus unit. mSv is the default and µSv can be picked. The value is kept as read, never converted.

Atemschutz tab

  • A Strahlenschutztrupp's row gets a Strahlenschutz button and an amber hint for what is still owed: "Dosimeter-Nr. fehlen", or "Ablesewert offen".
  • IM EINSATZ is held back until both dosimeters of every crew member are numbered or confirmed as nicht vorhanden. Maske and PA stay optional.
  • The dialog has one block per crew member. Nicht vorhanden asks first, because it breaks the documentation chain. It writes an ACHTUNG … line to the ETB, and the Bericht prints it dark red.
  • The Ablesewert can come in after Abnehmen, since the Dekon-Platz reports late. Each entry is its own ETB line with its own time.

Closing the Einsatz is refused while a started Strahlenschutztrupp still owes a reading. It is not merely warned about, because a closed Einsatz is read-only. The refusal names the Trupps, and its button leads to the Atemschutzüberwachung. The domain refuses too, since a client's close reaches the host as a command.

Bericht (PDF): one line per crew member with the numbers and the Ablesewert, offen or nicht vorhanden.

Schema, sync, trust boundaries

  • Incident schema V46.
    • New columns: scba_trupps.radiation_monitoring, plus has_radiation, the number columns, dose_value and dose_unit on scba_trupp_members. All are declared in SchemaGuard.ExpectedColumns.
    • Older files read back with no Trupp under the Überwachung. docs/samples/uebung.lagebuch was regenerated.
  • Stammdaten: radiationMonitoring on a Trupp-Typ, covering JSON, md_trupp_types, the editor column, docs/master-data.example.json, the round-trip fixture and docs/master-data.md. There is no automatic migration: which Trupp-Typ is under the Überwachung is the brigade's choice to tick.
  • Sync protocol 45, floor 45.
    • A client may send recordScbaRadiation.
    • addScbaTrupp carries radiationMonitoring. A host at 44 would drop it, registering the Trupp outside the Überwachung and letting the Einsatz close without its readings.
  • Untrusted input:
    • A handed-over .lagebuch and a host snapshot are read leniently through RadiationRecord.FromUntrusted. A number over 50 characters is cut, and an out-of-range reading or unknown unit is dropped, never fatal.
    • A client's command goes through the checking constructor and is refused.
    • Tests replay each case.

Screenshots

Atemschutz: before, and after with Dosimeter-Nr. fehlen and IM EINSATZ held back.

Atemschutz before
Atemschutz after

Strahlenschutz dialog: numbers, Ablesewert with mSv, and the confirmation for nicht vorhanden.

Strahlenschutz dialog

Stammdaten → Trupp-Typen: the new STRAHLENSCHUTZ column.

Trupp-Typen before
Trupp-Typen after

Verification

  • Clean Release build on LageBuch.Desktop.slnf (clean, rm bin/obj, restore --locked-mode, build, test): 0 warnings.
    • Everything passes except the four symlink tests (AttachmentTempPathsTests ×3, IncidentFileStoreTests ×1). They test code this PR does not touch and fail on this Windows machine because it lacks the symlink privilege; they fail on main there too.
  • Mutation testing on changed lines, run locally like CI's mutate-diff: Domain 97 %, Documents 100 %, Persistence 100 %, AppLogic 96.8 %.
    • The three AppLogic survivors are First→FirstOrDefault swaps on Trupps and members that always exist.
    • Local note: Stryker's {a..b} span globs match nothing on Windows, so whole changed files were mutated and scored on changed lines.
  • New tests:
    • Domain: rules, refusals, limits, lenient reading.
    • Persistence: round trip, hostile file, V45 file.
    • Sync: commands over the wire, hostile command, snapshot.
    • AppLogic: form, row, dialog, ETB wording, close refusal.
    • Documents: PDF lines and style.
    • Acceptance: row, dialog, editor column, and the overlay keyboard contract.
  • make codeql was not run: the script supports Linux/macOS only. The diff was checked by hand against the AGENTS.md query table.

🤖 Generated with Claude Code

A Trupp-Typ can be marked "Strahlenschutz" in the Stammdaten. A Trupp
of that type copies the flag at registration, and every Einsatzkraft
in it carries a record: OSL-Dosimeter, Alarmdosimeter, Maske and PA
numbers, and the Alarmdosimeter's Ablesewert in mSv (default) or µSv,
kept as read and never converted.

- The row offers STRAHLENSCHUTZ, a dialog with one block per crew
  member, and an amber hint for what is still owed.
- IM EINSATZ waits until both dosimeters of everyone are numbered or
  confirmed as nicht vorhanden.
- "Nicht vorhanden" asks first, because it breaks the documentation
  chain, and writes an ACHTUNG line to the ETB. The Bericht prints it
  dark red.
- The Ablesewert can follow after Abnehmen, since the Dekon-Platz
  reports late. Closing the Einsatz is refused, in the view model and
  in the domain, until every started Strahlenschutztrupp has one or a
  confirmed missing dosimeter per member.

The incident schema moves to V46 (declared in SchemaGuard). A handed-
over file and a host's snapshot are read leniently through
RadiationRecord.FromUntrusted; a client's command is checked strictly.
Protocol 45 adds recordScbaRadiation and radiationMonitoring on
addScbaTrupp, which a host at 44 would drop, so the floor rises to 45.

Closes #994

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Christian Arlt <c.arlt@gmx.de>
@coderabbitai

coderabbitai Bot commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

This branch has not been deployed

No deployments
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.

1 participant