From the user's test of #427: assigning a Prüfobjekt to a project, or removing it from one, did not appear in the workspace audit log.
What
PATCH /api/v1/targets/{id} with project_ids that actually change writes to POST /v1/audit. The payload follows the contract agreed with the portal session:
## Why
From the user's test of #427: assigning a Prüfobjekt to a project, or removing it from one, did not appear in the workspace audit log.
## What
- `PATCH /api/v1/targets/{id}` with `project_ids` that actually change writes to `POST /v1/audit`. The payload follows the contract agreed with the portal session:
- `action: target.projects_changed`, `product: pruefwerk`;
- `actor_type`: `user`, or `staff` under support access; `actor_id` is the sub, `actor_name` the name or "BreakPilot-Support (Name)";
- `target_type: target`, `target_id` (24-hex), `target_name`;
- `metadata: {added: [{id, name}], removed: [{id, name}]}`. Names come from the cached registry list; a deleted project has `name: ""`.
- A no-op PATCH writes nothing. The write is background and best-effort, and a registry outage never fails the PATCH.
- `AuditEntry` gains `product`, `actor_type` and `target_*`; the support-access audit (#425) now carries `product` and `actor_type` too.
## Tests
- change audited with names, including a deleted project
- staff actor type; no-op → no entry
- core/agent suites; clippy (CI flags); fmt
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
A change of a target's projects (PATCH with a real difference) writes
target.projects_changed to the registry's audit log: who (user, or staff
under support access), which target, and the projects added and removed
by name (a deleted project with an empty name). Background and
best-effort; a no-op writes nothing. Audit entries now carry product,
actor_type and the target they concern.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang
merged commit 001ab17b47 into main2026-09-29 14:34:35 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Why
From the user's test of #427: assigning a Prüfobjekt to a project, or removing it from one, did not appear in the workspace audit log.
What
PATCH /api/v1/targets/{id}withproject_idsthat actually change writes toPOST /v1/audit. The payload follows the contract agreed with the portal session:action: target.projects_changed,product: pruefwerk;actor_type:user, orstaffunder support access;actor_idis the sub,actor_namethe name or "BreakPilot-Support (Name)";target_type: target,target_id(24-hex),target_name;metadata: {added: [{id, name}], removed: [{id, name}]}. Names come from the cached registry list; a deleted project hasname: "".AuditEntrygainsproduct,actor_typeandtarget_*; the support-access audit (#425) now carriesproductandactor_typetoo.Tests
🤖 Generated with Claude Code
https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p