Skip to content

Self-hosted project management for devs and their clients: tickets, time tracking, docs and meetings, with an AI assistant that cites its sources. AGPL-3.0.

Describe the ticket changes endpoint in the maps

Guido Boyke19714964a06c
diff --git a/CLAUDE.md b/CLAUDE.md
index 36ac0fe..e891089 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -910,8 +910,33 @@ a retry with the same key wrote it twice, because the key keeps only successes.
`posts.plain`. Guards:
`spec/requests/api/v1/post_comment_format_spec.rb`, `spec/services/posts/comment_spec.rb`,
`spec/requests/api/mcp_plain_comment_spec.rb`, `spec/locales/token_rule_refusal_texts_spec.rb`
-(the refusals of `Posts::Comment` and `TimeSessions::Booking`, the MCP texts and the de and en
-keys are three lists kept by hand; the guard holds them together).
+(the refusals of `Posts::Comment`, `TimeSessions::Booking` and `Tickets::Change`, the MCP texts and
+the de and en keys are three lists kept by hand; the guard holds them together).
+
+`POST /api/v1/tickets/:id/changes` (REST R3b, 2026-10-30, API 1.7.0, capability
+`tickets.changes`) changes ONE thing by the rule the MCP tool `update_ticket` changes by,
+`Tickets::Change`: `change[title]`, `change[status]` (a key of `meta.available_statuses`), or
+`change[add_assignee_ids]` and `change[remove_assignee_ids]` (at most 50 each, `"me"` is the token
+owner) against the current list. The kind is decided by the keys present, not their values. It
+answers 200 with the ticket summary, like `PATCH /tickets/:id`, which stays as it is: its
+`assignee_ids` REPLACE the list, and `gboyke/lalabase-mcp` relies on that. Status and assignees
+go through `Actors::ApplyTicketChanges` like a board drag (a `TicketBulkRun` included), the title
+through `Actors::SaveTicket` alone under a lock on the row in its project, so the side effects are
+the web's and MCP's, once. Order: read-only token 403, then the read gate (missing, malformed,
+foreign, out of reach, hidden: one 404, whatever the body), then `authorize :update?` (403, whatever
+the body), and only then the input, so a refusal of it only ever answers a caller who may write.
+Input refused (mixed kinds, an unknown key, no `change`, the title rule, a list that is no list,
+over 50, the same person in both lists, text that is no UTF-8): 422
+`validation_failed`/`invalid_input`, a text from `services.ticket_change.*` that repeats nothing the
+client sent. Stopped by the project's state: 422 with `code: refused`, and `error` and `reason` the
+same word (`value_not_allowed`, `user_not_assignable`, `no_status_field`, `validation_failed`), a
+text from `services.ticket_change_failure.*` in `errors` and, for a title the model refuses, its
+messages behind it. The code is named in the controller: `Api::V1::ErrorBody` alone would read
+`validation_failed` as invalid input. Nobody is removed by a refused change, and a stale assignment
+stays unless it is named. A ticket that moved or was deleted after the rights check answers the same
+404; a failure the rule does not name answers 500 without its text. Guards:
+`spec/requests/api/v1/ticket_changes_spec.rb`, `spec/requests/api/v1/ticket_changes_side_effects_spec.rb`
+(the same trail as MCP), `spec/services/tickets/change_spec.rb`.
## Admin: Betreiber-Teile kommen nur über Schlitze
diff --git a/app/services/CLAUDE.md b/app/services/CLAUDE.md
index 79635ce..ce18f38 100644
--- a/app/services/CLAUDE.md
+++ b/app/services/CLAUDE.md
@@ -1,4 +1,4 @@
-# Karte: app/services (Stand: 2026-10-29)
+# Karte: app/services (Stand: 2026-10-30)
**Entry-Point-Konvention für NEUE Services: `Klass.call(**kwargs)`** (Klassenmethode; eine
Instanz-`#call`-Implementierung dahinter ist erlaubt). Pflicht: mindestens 1 Kommentarzeile
@@ -560,6 +560,14 @@ Bekannte Doppel-Verortungen (Altbestand; Boy-Scout-Regel: bei Berührung konsoli
`apply`/`restore`/`still_applied?`/`describe`; Fehler über `Invalid.with(code)`, weil die
Konvention Initializer ohne Positionsargumente will), `tickets/change_applier.rb` (EIN Ticket
im eigenen Sicherungspunkt, trägt das Rescue je Ticket, damit die Actors den Vertrag halten),
+ `tickets/change.rb` (REST R3b, 30.10.2026, nicht zu verwechseln mit dem Register
+ `tickets/changes*`) ist die EINE Regel einer Änderung über einen Token: das MCP-Werkzeug
+ `update_ticket` und `POST /api/v1/tickets/:id/changes` rufen sie. `parse` (Art nach
+ vorhandenem Schlüssel, Schlüssel, UTF-8, Titelregel, Listen, `"me"`), `write` (Status und
+ Personen über den Actor unten, Titel über `SaveTicket` unter Zeilensperre im Projekt) und
+ `Outcome` (geschrieben, Ticket weg, `FAILURES`, Unerwartetes). Rechte und Wortlaut bleiben in
+ den Hüllen; `REFUSALS`, `FAILURES`, die Tabellen des Werkzeugs und die `services.ticket_change*`-Schlüssel
+ in de und en hält `spec/locales/token_rule_refusal_texts_spec.rb` zusammen.
`actors/apply_ticket_changes.rb` (EIN Actor für eins und viele, D13; sperrt die Zeilen,
vergleicht den Bestand, schreibt den Durchlauf `TicketBulkRun`) und `actors/undo_ticket_bulk_run.rb`.
Seit 6b bedient `apply_ticket_changes` auch Board-Drag und Kommentar-Status mit einer Menge
diff --git a/app/services/lalabase/CLAUDE.md b/app/services/lalabase/CLAUDE.md
index e7181dd..e9fec91 100644
--- a/app/services/lalabase/CLAUDE.md
+++ b/app/services/lalabase/CLAUDE.md
@@ -1,4 +1,4 @@
-# Karte: app/services/lalabase (Stand: 2026-10-29)
+# Karte: app/services/lalabase (Stand: 2026-10-30)
AI/RAG-Domäne (Produktname „Lalabase"): alles rund um LLM-Aufrufe, Embeddings und
Codebase-Verständnis.
@@ -60,9 +60,14 @@ Codebase-Verständnis.
Zuweisung über `Actors::ApplyTicketChanges` wie Board und Kopfmenü, Titel über
`Actors::SaveTicket` ohne `assignee_ids` (das ersetzt die Liste), unter Zeilensperre im
Projekt (`SaveTicket` sucht organisationsweit und baut für eine fehlende ID ein NEUES
- Ticket). Unbekannte Argumente sind `invalid_input`. Schema bewusst flach, ohne `oneOf`:
+ Ticket). Unbekannte Argumente sind `invalid_input`. Die Regel, die Schreibwege und das
+ Einordnen der Ergebnisse liegen seit REST R3b in `Tickets::Change`, geteilt mit
+ `POST /api/v1/tickets/:id/changes`; im Werkzeug bleiben Argumente, Rechte, die Texte
+ (`REFUSAL_TEXT`, `FAILURE_TEXT`) und die Reihenfolge der Antworten: erst Schlüssel und
+ Kodierung (`unreadable?`), dann die eigene `ticket_id`, dann die Änderung
+ (`update_ticket_order_spec.rb`). Schema bewusst flach, ohne `oneOf`:
der Go-Client erkennt Funktionen nur an den obersten `properties`. Den Titel prüfen
- `create_ticket` und `update_ticket` gemeinsam (`tools/ticket_title.rb`): eine Zeile, höchstens
+ `create_ticket` und `Tickets::Change` gemeinsam (`tools/ticket_title.rb`): eine Zeile, höchstens
255 Zeichen, unsichtbare und Steuerzeichen abgelehnt, nicht bereinigt.
`post_comment` (MCP 0.11.0, terminal client S2b) takes optional `format`: `html`
(default, unchanged ActionText input) or `plain`. `Posts::PlainTextBody` escapes