feat(intake): record R1 security reports with one stable reference #119

Merged
sharang merged 3 commits from feat/r1-intake into main 2026-11-10 09:01:26 +00:00
Owner

docgen#6 slice 3, F01: the R1 intake records a security notice (P-R1-K05 Fassung 4, M21 and M13). Stage only; production needs a separate go, and the public form without an account stays behind B-1.

What it does

  • One original, one reference. A report is kept unchanged with the time it arrived and gets one stable Eingangsreferenz (SH-2026-00001). The Meldereferenz of the confirmation is the same string (F-1).
  • Supplements. Later information is a new entry under the same reference (M13), never a second report.
  • Insert-only. Migration 0028 adds intake_reports, intake_entries and intake_receipts. A trigger refuses every update. Each report has one capture, and each entry has at most one settling receipt.
  • Reporters. A person reports, lists and reads their own reports, and adds to them, with their own token (POST/GET /v1/tenants/{id}/intake/reports…, route group intake.user). Everyone else gets 404 (BM-7, AS-R1). Only what and the danger question are required; nothing asks for an assessment (AK-AS10, AK-AS11).
  • Handover to werkmeister. GET /v1/internal/intake/pending lists entries not settled yet. Each carries the reference and the reporter's own answers (what it is about, immediate danger), never the text. POST /v1/internal/intake/entries/{entry}/receipts records waiting, delivered, processed or refused (route group intake). A repeated receipt adds nothing. After processed or refused, further receipts get 409.
  • No route returns the original. Reading it needs the separate authority "Original einsehen" with an access log (F07, TV-1, slice 1), which doesn't exist yet.

Needs

platform-stage AUTHZ_RULES: portal-stage gets intake.user, and werkmeister-svc-stage gets intake. That goes in a separate orca-platform PR. Until then the routes refuse with FORBIDDEN_CLIENT.

Tests

  • HTTP and authz tests on the memory store.
  • The store contract on memory and Postgres.
  • Migration assertions: insert-only, one capture, one settling receipt, cascade.
  • Two mutations were caught: dropping the reporter check, and dropping the intake.user group.
  • Coverage is 79.9 % (gate 70 %).

platform-aa was told beforehand; no collision.

🤖 Generated with Claude Code

https://claude.ai/code/session_014aRnCGqELxoix5TfpX8Ejf

docgen#6 slice 3, F01: the R1 intake records a security notice (P-R1-K05 Fassung 4, M21 and M13). Stage only; production needs a separate go, and the public form without an account stays behind B-1. ## What it does - **One original, one reference.** A report is kept unchanged with the time it arrived and gets one stable Eingangsreferenz (`SH-2026-00001`). The Meldereferenz of the confirmation is the same string (F-1). - **Supplements.** Later information is a new entry under the same reference (M13), never a second report. - **Insert-only.** Migration 0028 adds `intake_reports`, `intake_entries` and `intake_receipts`. A trigger refuses every update. Each report has one capture, and each entry has at most one settling receipt. - **Reporters.** A person reports, lists and reads their own reports, and adds to them, with their own token (`POST/GET /v1/tenants/{id}/intake/reports…`, route group `intake.user`). Everyone else gets 404 (BM-7, AS-R1). Only `what` and the danger question are required; nothing asks for an assessment (AK-AS10, AK-AS11). - **Handover to werkmeister.** `GET /v1/internal/intake/pending` lists entries not settled yet. Each carries the reference and the reporter's own answers (what it is about, immediate danger), never the text. `POST /v1/internal/intake/entries/{entry}/receipts` records waiting, delivered, processed or refused (route group `intake`). A repeated receipt adds nothing. After processed or refused, further receipts get 409. - **No route returns the original.** Reading it needs the separate authority "Original einsehen" with an access log (F07, TV-1, slice 1), which doesn't exist yet. ## Needs platform-stage `AUTHZ_RULES`: `portal-stage` gets `intake.user`, and `werkmeister-svc-stage` gets `intake`. That goes in a separate orca-platform PR. Until then the routes refuse with `FORBIDDEN_CLIENT`. ## Tests - HTTP and authz tests on the memory store. - The store contract on memory and Postgres. - Migration assertions: insert-only, one capture, one settling receipt, cascade. - Two mutations were caught: dropping the reporter check, and dropping the `intake.user` group. - Coverage is 79.9 % (gate 70 %). platform-aa was told beforehand; no collision. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014aRnCGqELxoix5TfpX8Ejf
sharang added 1 commit 2026-11-10 08:50:54 +00:00
feat(intake): record R1 security reports with one stable reference
ci / shared (pull_request) Successful in 27s
ci / test (pull_request) Failing after 1m58s
ci / image (pull_request) Skipped
b4583de691
docgen#6 slice 3, F01 (P-R1-K05 Fassung 4 M21, M13): the R1 intake keeps
a security notice unchanged with the time it arrived and gives it one
stable Eingangsreferenz (SH-YYYY-NNNNN), which is also the Meldereferenz
of the confirmation (F-1). Later information is a supplement to the same
reference, never a second report.

- migration 0028: intake_reports, intake_entries (capture and
  supplements), intake_receipts; all insert-only (trigger), one capture
  per report, one settling receipt per entry
- a person reports, lists and reads their own reports and adds to them
  with their own token (route group intake.user); others get 404, and
  no route returns the original text, since "Original einsehen" (F07,
  TV-1) does not exist yet
- werkmeister reads entries not settled yet (reference and the
  reporter's own answers, never the text) and writes receipts back:
  waiting, delivered, processed, refused (route group intake)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014aRnCGqELxoix5TfpX8Ejf
sharang added 1 commit 2026-11-10 08:52:24 +00:00
feat(intake): pending entries carry the newest receipt's handoff
ci / shared (pull_request) Successful in 12s
ci / test (pull_request) Failing after 1m32s
ci / image (pull_request) Skipped
bf83d0625e
So the receiving service can look up a handoff it already made before it
repeats one (tenant-registry#119).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014aRnCGqELxoix5TfpX8Ejf
sharang added 1 commit 2026-11-10 08:53:37 +00:00
test(intake): plain error comparison in the store test
ci / shared (pull_request) Successful in 12s
ci / test (pull_request) Successful in 7m33s
ci / image (pull_request) Skipped
cc4675c85d
staticcheck flagged the double negation (tenant-registry#119).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014aRnCGqELxoix5TfpX8Ejf
sharang merged commit 54e55a5cc0 into main 2026-11-10 09:01:26 +00:00
sharang deleted branch feat/r1-intake 2026-11-10 09:01:27 +00:00
Sign in to join this conversation.