feat(notify): mail the workspace when a scan finds something new #360

Merged
sharang merged 1 commits from feat/findings-notification into main 2026-09-23 20:47:27 +00:00
Owner

F3 of the platform go-live plan (see #338): Prüfwerk's side of the new-findings mail.

  • After run_one_target_scan, a background task counts the target's findings with created_at >= scan start, by severity. The pipeline inserts only fingerprints it has not seen, so these are exactly the new ones. If there are any, it calls the registry's POST /v1/notifications (findings.new, idempotency key findings:<tenant>:<target>:<start>) with the target name, counts and an optional link.
  • The registry (tenant-registry#35) mails IT_ADMIN, OWNER, CXO and LEGAL in the BreakPilot layout, in German by default. Demo tenants get nothing.
  • DASHBOARD_PUBLIC_URL (https only) makes the mail link to /findings?target=<id>. Unset, the mail links the portal dashboard.
  • Pipeline files untouched (orchestrator.rs is yours): only agent.rs and registry.rs change. The registry client needs the notify route group for pruefwerk-svc-* (orca-platform#30 for stage).

CI clippy flags pass; the new unit test passes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB

F3 of the platform go-live plan (see #338): Prüfwerk's side of the new-findings mail. - After `run_one_target_scan`, a background task counts the target's findings with `created_at >= scan start`, by severity. The pipeline inserts only fingerprints it has not seen, so these are exactly the new ones. If there are any, it calls the registry's `POST /v1/notifications` (`findings.new`, idempotency key `findings:<tenant>:<target>:<start>`) with the target name, counts and an optional link. - The registry (tenant-registry#35) mails IT_ADMIN, OWNER, CXO and LEGAL in the BreakPilot layout, in German by default. Demo tenants get nothing. - `DASHBOARD_PUBLIC_URL` (https only) makes the mail link to `/findings?target=<id>`. Unset, the mail links the portal dashboard. - **Pipeline files untouched** (`orchestrator.rs` is yours): only `agent.rs` and `registry.rs` change. The registry client needs the `notify` route group for `pruefwerk-svc-*` (orca-platform#30 for stage). CI clippy flags pass; the new unit test passes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
sharang added 1 commit 2026-09-23 20:21:32 +00:00
feat(notify): mail the workspace when a scan finds something new
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 6m15s
90a9b10eaa
After a scan the agent counts the findings of that target first
stored since the scan started (the pipeline only inserts a finding
whose fingerprint is new), by severity, and posts them to the
registry's POST /v1/notifications as findings.new. The registry mails
the people who run the workspace in the BreakPilot layout. Background
and best-effort; nothing without a registry or without new findings.
DASHBOARD_PUBLIC_URL (https) adds a link to the target's findings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
sharang merged commit 6a6587a074 into main 2026-09-23 20:47:27 +00:00
Sign in to join this conversation.