feat(findings): two kinds of Fehlalarm, the rule's and the mapping's #417

Merged
sharang merged 1 commits from feat/fehlalarm-split into main 2026-09-28 18:55:54 +00:00
Owner

Splits "Fehlalarm" into its two kinds before the pilot, so the labels users set from Wednesday on are clean training data for the finding classifier (#416).

Label Status Meaning
Fehlalarm – Regel false_positive (existing, relabelled) The rule fired on code that is fine: the finding is not real
Fehlalarm – Zuordnung wrong_mapping (new) The finding may be real, but it does not violate the CRA requirement it was mapped to

Behaviour

  • A reason is required for a wrong mapping, like an accepted risk.
    • FindingStatus::needs_reason() is shared by the agent and the dashboard.
    • The agent answers 422 without a reason.
    • The finding's page asks for one: "Warum verletzt der Befund die zugeordnete CRA-Anforderung nicht …"
    • The reason goes into the status history with who set it and when.
  • CRA status and OSCAL: a wrong mapping no longer counts against its controls. The finding keeps its control_refs, so which mapping was wrong stays on record, and the semantic pass skips it on rescans.
  • Bulk actions offer neither status that needs a reason; those are set on each finding's page.
  • MCP: the status list and counts include wrong_mapping.

Checks

  • fmt, and clippy with the CI flags on core, agent, MCP and both dashboard feature sets.
  • Tests: core 75, agent lib 459, dashboard 45 + 61.
  • New assertions:
    • a wrong mapping without a reason gets a 422;
    • a false positive still needs no reason;
    • a wrong-mapping finding no longer violates its control.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p

Splits "Fehlalarm" into its two kinds before the pilot, so the labels users set from Wednesday on are clean training data for the finding classifier (#416). | Label | Status | Meaning | |---|---|---| | **Fehlalarm – Regel** | `false_positive` (existing, relabelled) | The rule fired on code that is fine: the finding is not real | | **Fehlalarm – Zuordnung** | `wrong_mapping` (new) | The finding may be real, but it does not violate the CRA requirement it was mapped to | ## Behaviour - **A reason is required for a wrong mapping**, like an accepted risk. - `FindingStatus::needs_reason()` is shared by the agent and the dashboard. - The agent answers 422 without a reason. - The finding's page asks for one: *"Warum verletzt der Befund die zugeordnete CRA-Anforderung nicht …"* - The reason goes into the status history with who set it and when. - **CRA status and OSCAL:** a wrong mapping no longer counts against its controls. The finding keeps its `control_refs`, so which mapping was wrong stays on record, and the semantic pass skips it on rescans. - **Bulk actions** offer neither status that needs a reason; those are set on each finding's page. - **MCP:** the status list and counts include `wrong_mapping`. ## Checks - fmt, and clippy with the CI flags on core, agent, MCP and both dashboard feature sets. - Tests: core 75, agent lib 459, dashboard 45 + 61. - New assertions: - a wrong mapping without a reason gets a 422; - a false positive still needs no reason; - a wrong-mapping finding no longer violates its control. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang added 1 commit 2026-09-28 17:34:48 +00:00
feat(findings): two kinds of Fehlalarm, the rule's and the mapping's
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 7m1s
c529d63cb1
A finding a person rejects can be wrong in two ways, and they need
different fixes: the rule fired on code that is fine ("Fehlalarm –
Regel", the existing false_positive, relabelled), or the finding is real
but does not violate the CRA requirement it was mapped to ("Fehlalarm –
Zuordnung", a new wrong_mapping status). Kept apart, they become clean
labels for the finding classifier (#416).

A wrong mapping needs a reason, like an accepted risk (FindingStatus::
needs_reason, enforced by the agent and asked for on the finding's page).
It no longer counts against its controls in the CRA status or the OSCAL
report; the finding keeps its control refs, so which mapping was wrong
stays on record, and the semantic pass does not map it again. Bulk actions
offer neither status that needs a reason.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang merged commit 8972db0594 into main 2026-09-28 18:55:54 +00:00
Sign in to join this conversation.