Files
werkregie/doc/prs/2026-10-14-PR#84-journal-crap.md
claude-code d466cf3561
werkator build succeeded after 01:37
werkator/deploy build succeeded after 00:35
JournalProposer at a Mutation-CRAP of at most 15 (#84)
Co-authored-by: claude-code <claude-code@javagil.de>
2026-10-14 22:12:47 +02:00

40 lines
1.7 KiB
Markdown

# PR#84: JournalProposer at a Mutation-CRAP of at Most 15
Version: patch
> **WARNING:** This document describes only the change applied in this PR.
> It may already be outdated once the next PR is merged.
> Historic PR documentation is not maintained along with new PRs; treat it as a snapshot.
## Problem
The next feature, an AI summary as the description of a Werkjournal entry, changes `journal/JournalProposal.kt`.
A branch fails on each method above a Mutation-CRAP of 15 in a file it changes, and four methods of `JournalProposer` are above:
`inRoom` 90, `targetOf` 84, `propose` 41 and `description` 16.
## Non-Goals
- No change of the proposal; the same day gives the same file as before.
## Specification
None; the behaviour stays the same.
## Solution
- `propose` hands each session and each item to `addSession`, `addItem` and `addGitea`, and the short stories to `joinShortStories`.
- `targetOf` asks `holds` whether a project takes the work, and `unmappedName` how to name work that none takes;
both and `inRoom` are functions of the companion, tested apart.
- `description` takes its pull requests from `pullRequests`.
- New tests in [JournalProposerTest](../../dashboard/src/test/kotlin/de/hoennig/werkregie/dashboard/journal/JournalProposerTest.kt): the four ways a project holds work, a room by ID or name,
the name of unmapped work, Taiga, Matrix and builds in one day, and the pull requests of the evidence.
- `pitestPartial mutationCrapCheck` against main: the highest Mutation-CRAP of `JournalProposer` is 14, `storyOf`.
## Open Questions
None.
## Follow-up PRs
- An AI summary as the description of a Werkjournal entry, with a switch in the tab Journal (`#dash.journal.proposal`).