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.

Record the plain ticket body on a ticket with a stable comment order

Guido Boykeacbc0977609e
diff --git a/spec/contracts/mcp_contract_recorder.rb b/spec/contracts/mcp_contract_recorder.rb
index 74c1b03..b256692 100644
--- a/spec/contracts/mcp_contract_recorder.rb
+++ b/spec/contracts/mcp_contract_recorder.rb
@@ -474,24 +474,28 @@ module McpContract
end
# Each request from its own line (Prosopite). `show` is the ticket without
- # paging parameters: its body must stay what gboyke/lalabase-mcp reads.
+ # paging parameters: its body must stay what gboyke/lalabase-mcp reads. It
+ # shows the export ticket: that body lists every comment by created_at only,
+ # and the writes above left several comments on the login ticket in the same
+ # second.
# The answers after `show` are the R1 additions: a page, a refused option,
# the ticket by number (and a number that is not there or not readable),
# one comment and a missing one.
def rest_ticket_view_calls
login = "/api/v1/tickets/#{id(:login_ticket)}"
+ export = "/api/v1/tickets/#{id(:export_ticket)}"
by_number = ->(project, number) { "/api/v1/projects/#{id(project)}/tickets/number/#{number}" }
{
# Filtered to Ben's one ticket: the writes above left both website
# tickets with the same updated_at, and the list has no second sort key.
'list' => rest_get(:read, "/api/v1/projects/#{id(:website)}/tickets?assignee=#{id(:ben)}"),
- 'show' => rest_get(:read, login),
+ 'show' => rest_get(:read, export),
# Oldest first: the second comment was made with its own clock tick, while
# the comments the recorded writes added share one second and would be
# ordered by their random ids.
'show_paged' => rest_get(:read, "#{login}?posts_per_page=1&posts_page=2&attachments_page=1"),
'show_invalid_paging' => rest_get(:read, "#{login}?posts_order=random"),
- 'by_number' => rest_get(:read, by_number.call(:website, 1)),
+ 'by_number' => rest_get(:read, by_number.call(:website, 2)),
'by_number_not_found' => rest_get(:read, by_number.call(:website, 999)),
# No read access to the handbook's tickets: answered like a missing number.
'by_number_hidden' => rest_get(:read, by_number.call(:handbook, 1)),
diff --git a/spec/fixtures/mcp_contract.json b/spec/fixtures/mcp_contract.json
index 8e0621c..0b9658d 100644
--- a/spec/fixtures/mcp_contract.json
+++ b/spec/fixtures/mcp_contract.json
@@ -1,9 +1,9 @@
{
"header": {
"regenerate": "RAILS_ENV=test bin/rails mcp:contract",
- "core_commit": "d65653e2f2f97830d0a0bd7eeec32e61ee04710a",
+ "core_commit": "14fb8dae1789251791aa467a40e561067042e4c5",
"core_dirty": true,
- "contract_sha256": "74378fb5a0725c5d4d72633c74372240663e936e2e0b126d48b769d9e094fbf5"
+ "contract_sha256": "3b3dedf189048147ae11c6f632eba01cbe0f4bf444bda60a588e3265c2b3280a"
},
"contract": {
"mcp": {
@@ -3658,15 +3658,15 @@
"show": {
"token": "read",
"request": {
- "path": "/api/v1/tickets/00000000-0000-4000-8000-000000000041"
+ "path": "/api/v1/tickets/00000000-0000-4000-8000-000000000042"
},
"response": {
"status": 200,
"body": {
"data": {
- "id": "00000000-0000-4000-8000-000000000041",
- "number": 1,
- "title": "Login bricht ab",
+ "id": "00000000-0000-4000-8000-000000000042",
+ "number": 2,
+ "title": "Export als CSV und XLSX",
"status": "in_progress",
"status_functions": [
"is_in_progress"
@@ -3677,126 +3677,26 @@
{
"id": "00000000-0000-4000-8000-000000000011",
"name": "Anna Albers"
- },
- {
- "id": "00000000-0000-4000-8000-000000000012",
- "name": "Ben Berger"
- },
- {
- "id": "00000000-0000-4000-8000-000000000013",
- "name": "Carla Conrad"
}
],
"creator": {
- "id": "00000000-0000-4000-8000-000000000011",
- "name": "Anna Albers"
+ "id": "00000000-0000-4000-8000-000000000012",
+ "name": "Ben Berger"
},
- "created_at": "2026-01-05T09:21:00Z",
+ "created_at": "2026-01-05T09:22:00Z",
"updated_at": "2026-01-05T09:36:00Z",
"summary": null,
- "description_html": "Nach dem Absenden bleibt die Seite weiß.",
- "description_text": "Nach dem Absenden bleibt die Seite weiß.",
+ "description_html": "Spalten wie in der Liste.",
+ "description_text": "Spalten wie in der Liste.",
"custom_attributes": {
"status": "in_progress",
- "priority": "high"
+ "priority": "normal"
},
"project": {
"id": "00000000-0000-4000-8000-000000000031",
"name": "Website-Relaunch"
},
- "posts": [
- {
- "id": "00000000-0000-4000-8000-000000000051",
- "author": {
- "id": "00000000-0000-4000-8000-000000000012",
- "name": "Ben Berger"
- },
- "body_html": "Tritt nur in Safari auf.",
- "body_text": "Tritt nur in Safari auf.",
- "is_private": false,
- "attachments_count": 1,
- "created_at": "2026-01-05T09:25:00Z",
- "updated_at": "2026-01-05T09:36:00Z"
- },
- {
- "id": "00000000-0000-4000-8000-000000000052",
- "author": {
- "id": "00000000-0000-4000-8000-000000000011",
- "name": "Anna Albers"
- },
- "body_html": "Ich schaue es mir an.",
- "body_text": "Ich schaue es mir an.",
- "is_private": false,
- "attachments_count": 0,
- "created_at": "2026-01-05T09:26:00Z",
- "updated_at": "2026-01-05T09:26:00Z"
- },
- {
- "id": "<generated-id-1>",
- "author": {
- "id": "00000000-0000-4000-8000-000000000011",
- "name": "Anna Albers"
- },
- "body_html": "Behoben in 2.4.1.",
- "body_text": "Behoben in 2.4.1.",
- "is_private": false,
- "attachments_count": 0,
- "created_at": "2026-01-05T09:36:00Z",
- "updated_at": "2026-01-05T09:36:00Z"
- },
- {
- "id": "<generated-id-2>",
- "author": {
- "id": "00000000-0000-4000-8000-000000000011",
- "name": "Anna Albers"
- },
- "body_html": "<p>line one<br>line two</p><p>see &lt;file.txt&gt; &amp;lt;tag&amp;gt;</p>",
- "body_text": "line one\nline two\n\nsee <file.txt> &lt;tag&gt;",
- "is_private": false,
- "attachments_count": 0,
- "created_at": "2026-01-05T09:36:00Z",
- "updated_at": "2026-01-05T09:36:00Z"
- },
- {
- "id": "<generated-id-3>",
- "author": {
- "id": "00000000-0000-4000-8000-000000000011",
- "name": "Anna Albers"
- },
- "body_html": "<p><b>bold</b></p>",
- "body_text": "bold",
- "is_private": false,
- "attachments_count": 0,
- "created_at": "2026-01-05T09:36:00Z",
- "updated_at": "2026-01-05T09:36:00Z"
- },
- {
- "id": "<generated-id-4>",
- "author": {
- "id": "00000000-0000-4000-8000-000000000011",
- "name": "Anna Albers"
- },
- "body_html": "<p>&lt;private&gt;</p>",
- "body_text": "<private>",
- "is_private": true,
- "attachments_count": 0,
- "created_at": "2026-01-05T09:36:00Z",
- "updated_at": "2026-01-05T09:36:00Z"
- },
- {
- "id": "<generated-id-7>",
- "author": {
- "id": "00000000-0000-4000-8000-000000000011",
- "name": "Anna Albers"
- },
- "body_html": "Per REST, einmal.",
- "body_text": "Per REST, einmal.",
- "is_private": false,
- "attachments_count": 0,
- "created_at": "2026-01-05T09:36:00Z",
- "updated_at": "2026-01-05T09:36:00Z"
- }
- ]
+ "posts": []
},
"permissions": {
"is_account_admin": false,
@@ -3962,15 +3862,15 @@
"by_number": {
"token": "read",
"request": {
- "path": "/api/v1/projects/00000000-0000-4000-8000-000000000031/tickets/number/1"
+ "path": "/api/v1/projects/00000000-0000-4000-8000-000000000031/tickets/number/2"
},
"response": {
"status": 200,
"body": {
"data": {
- "id": "00000000-0000-4000-8000-000000000041",
- "number": 1,
- "title": "Login bricht ab",
+ "id": "00000000-0000-4000-8000-000000000042",
+ "number": 2,
+ "title": "Export als CSV und XLSX",
"status": "in_progress",
"status_functions": [
"is_in_progress"
@@ -3981,126 +3881,26 @@
{
"id": "00000000-0000-4000-8000-000000000011",
"name": "Anna Albers"
- },
- {
- "id": "00000000-0000-4000-8000-000000000012",
- "name": "Ben Berger"
- },
- {
- "id": "00000000-0000-4000-8000-000000000013",
- "name": "Carla Conrad"
}
],
"creator": {
- "id": "00000000-0000-4000-8000-000000000011",
- "name": "Anna Albers"
+ "id": "00000000-0000-4000-8000-000000000012",
+ "name": "Ben Berger"
},
- "created_at": "2026-01-05T09:21:00Z",
+ "created_at": "2026-01-05T09:22:00Z",
"updated_at": "2026-01-05T09:36:00Z",
"summary": null,
- "description_html": "Nach dem Absenden bleibt die Seite weiß.",
- "description_text": "Nach dem Absenden bleibt die Seite weiß.",
+ "description_html": "Spalten wie in der Liste.",
+ "description_text": "Spalten wie in der Liste.",
"custom_attributes": {
"status": "in_progress",
- "priority": "high"
+ "priority": "normal"
},
"project": {
"id": "00000000-0000-4000-8000-000000000031",
"name": "Website-Relaunch"
},
- "posts": [
- {
- "id": "00000000-0000-4000-8000-000000000051",
- "author": {
- "id": "00000000-0000-4000-8000-000000000012",
- "name": "Ben Berger"
- },
- "body_html": "Tritt nur in Safari auf.",
- "body_text": "Tritt nur in Safari auf.",
- "is_private": false,
- "attachments_count": 1,
- "created_at": "2026-01-05T09:25:00Z",
- "updated_at": "2026-01-05T09:36:00Z"
- },
- {
- "id": "00000000-0000-4000-8000-000000000052",
- "author": {
- "id": "00000000-0000-4000-8000-000000000011",
- "name": "Anna Albers"
- },
- "body_html": "Ich schaue es mir an.",
- "body_text": "Ich schaue es mir an.",
- "is_private": false,
- "attachments_count": 0,
- "created_at": "2026-01-05T09:26:00Z",
- "updated_at": "2026-01-05T09:26:00Z"
- },
- {
- "id": "<generated-id-1>",
- "author": {
- "id": "00000000-0000-4000-8000-000000000011",
- "name": "Anna Albers"
- },
- "body_html": "Behoben in 2.4.1.",
- "body_text": "Behoben in 2.4.1.",
- "is_private": false,
- "attachments_count": 0,
- "created_at": "2026-01-05T09:36:00Z",
- "updated_at": "2026-01-05T09:36:00Z"
- },
- {
- "id": "<generated-id-2>",
- "author": {
- "id": "00000000-0000-4000-8000-000000000011",
- "name": "Anna Albers"
- },
- "body_html": "<p>line one<br>line two</p><p>see &lt;file.txt&gt; &amp;lt;tag&amp;gt;</p>",
- "body_text": "line one\nline two\n\nsee <file.txt> &lt;tag&gt;",
- "is_private": false,
- "attachments_count": 0,
- "created_at": "2026-01-05T09:36:00Z",
- "updated_at": "2026-01-05T09:36:00Z"
- },
- {
- "id": "<generated-id-3>",
- "author": {
- "id": "00000000-0000-4000-8000-000000000011",
- "name": "Anna Albers"
- },
- "body_html": "<p><b>bold</b></p>",
- "body_text": "bold",
- "is_private": false,
- "attachments_count": 0,
- "created_at": "2026-01-05T09:36:00Z",
- "updated_at": "2026-01-05T09:36:00Z"
- },
- {
- "id": "<generated-id-4>",
- "author": {
- "id": "00000000-0000-4000-8000-000000000011",
- "name": "Anna Albers"
- },
- "body_html": "<p>&lt;private&gt;</p>",
- "body_text": "<private>",
- "is_private": true,
- "attachments_count": 0,
- "created_at": "2026-01-05T09:36:00Z",
- "updated_at": "2026-01-05T09:36:00Z"
- },
- {
- "id": "<generated-id-7>",
- "author": {
- "id": "00000000-0000-4000-8000-000000000011",
- "name": "Anna Albers"
- },
- "body_html": "Per REST, einmal.",
- "body_text": "Per REST, einmal.",
- "is_private": false,
- "attachments_count": 0,
- "created_at": "2026-01-05T09:36:00Z",
- "updated_at": "2026-01-05T09:36:00Z"
- }
- ]
+ "posts": []
},
"permissions": {
"is_account_admin": false,