Skip to content

Label cases by Bereich, Testart, Frageform and Herkunft - #291

Merged
mt0rm0 merged 1 commit into
284-number-and-label-casesfrom
286-label-cases
Oct 16, 2026
Merged

mt0rm0 merged 1 commit into
284-number-and-label-casesfrom
286-label-cases

Conversation

@mt0rm0

@mt0rm0 mt0rm0 commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Closes #286

Every case now carries four labels, so a round can be broken down by what each case is meant to test.

  • Kategorie (shown as Bereich) stays where it was, but is an open list: the built-in GO, GV, AR, FI, WI, or any code of one to eight letters or digits, such as WD3.
  • Testart (new): Regelfall, Präzision, Quellenwahl, Synthese, and four kinds of Grenzfall, or any value typed in. Each has a three-letter code for tags (PRZ, GAB, …); a typed-in one gets its first three letters.
  • Frageform (new): allgemein or konkret.
  • Herkunft (new): Prüfer-Vorlage, Hotline, Feedback, manuell, or any value.

Labels live on the case, not its versions: PATCH /api/eval/cases/{nummer}/labels corrects them without creating a version. GET /api/eval/labels returns the values to offer per dimension, built-in ones first, then those in use, so a value added by hand disappears once no case uses it. Nothing stores the list itself.

A generated tag is now <Kategorie>-<Testart code>-<nnn>, e.g. FI-PRZ-001, or FI-001 without a Testart, and follows label changes. A tag set by hand stays.

Choosing the Testart "Grenzfall · außerhalb des Bestands" sets the draft's grenzfall flag, and choosing another unsets it. An approved version keeps its flag, since it is what a round measured against.

Migration 0014_case_labels fills the new labels for existing cases: Herkunft from grund_fuer_aufnahme or the feedback origin, Frageform from the reviewer note, Testart only for Grenzfälle.

🤖 Generated with Claude Code

Testart, Frageform and Herkunft join the Kategorie on the case, not its
versions, so correcting a label creates no version. Kategorie and Testart are
open lists: the built-in values are always offered, and a value typed in is
offered while a case uses it and gone once none does.

A generated tag is now <Kategorie>-<Testart code>-<nnn> and follows label
changes; a hand-set one stays. The Testart "Grenzfall · außerhalb des
Bestands" keeps a draft's grenzfall flag in step. Migration 0014 fills the
new labels for existing cases from what is already recorded.
@mt0rm0

mt0rm0 commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

Other infos

  • Evaluation: 436 passed (new: test_labels.py, and label, tag and offered-value tests in test_cases_api.py). mypy src clean. Frontend: 173 passed; only the type gained optional fields here, the screen comes in Show and edit number, tag and labels in Administration #288.
  • On a copy of the local eval DB, 0013 and 0014 ran in sequence. 33 reviewer cases got Herkunft Prüfer-Vorlage with their Frageform (17 allgemein, 16 konkret), 7 got manuell, and 3 Grenzfälle got the Grenzfall Testart. Downgrading to 0013 worked. The migration tests pass on an empty Postgres.
  • One existing test asserted that an unknown category is rejected. With open lists that is the wrong rule, so it now asserts that a new one is accepted and normalised (wd3 becomes WD3), and that only a malformed one is rejected.
  • The reviewer import still refuses a Fachbereich without a mapping. Accepting it as a new category is part of Set labels on import and through the templates #287.

@coderabbitai

coderabbitai Bot commented Oct 16, 2026

Copy link
Copy Markdown

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
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 810d1873-c32c-4008-9791-fa47696139c2

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

Comment @coderabbitai help to get the list of available commands.

@mt0rm0
mt0rm0 merged commit ce5b0fb into 284-number-and-label-cases Oct 16, 2026
5 checks passed
@mt0rm0
mt0rm0 deleted the 286-label-cases branch October 16, 2026 13:36
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