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 comment endpoint's answers without format before R3a

Guido Boykea8b55c99d578
diff --git a/spec/contracts/mcp_contract_recorder.rb b/spec/contracts/mcp_contract_recorder.rb
index cbef45f..9cbb676 100644
--- a/spec/contracts/mcp_contract_recorder.rb
+++ b/spec/contracts/mcp_contract_recorder.rb
@@ -539,7 +539,10 @@ module McpContract
'idempotency' => rest_idempotency_calls,
# People S3b, appended last: the directory of people_world, made before the MCP calls.
'GET /api/v1/organisations/:organisation_id/people' => rest_people_list_calls,
- 'GET /api/v1/organisations/:organisation_id/people/:id' => rest_people_show_calls
+ 'GET /api/v1/organisations/:organisation_id/people/:id' => rest_people_show_calls,
+ # REST R3a (cli_rest_plan R3 a), appended last: its comments land on the
+ # login ticket after every answer above, without advancing the clock.
+ 'POST /api/v1/tickets/:ticket_id/posts' => rest_comment_calls
}
end
@@ -579,6 +582,19 @@ module McpContract
}
end
+ # Each request from its own line (Prosopite). The answers without `format`
+ # (and with `format: html`) were recorded before R3a and must stay as
+ # they were: existing callers send no format.
+ def rest_comment_calls
+ login = "/api/v1/tickets/#{id(:login_ticket)}/posts"
+ {
+ 'html' => rest_send(:post, :write, login, params: { post: { body: '<p>Ein <b>fetter</b> Satz &amp; mehr</p>' } }),
+ 'html_named' => rest_send(:post, :write, login, params: { post: { format: 'html', body: '<p>Noch ein <i>Satz</i></p>' } }),
+ # The model refuses an empty body, with its own message.
+ 'html_empty' => rest_send(:post, :write, login, params: { post: { body: '' } })
+ }
+ end
+
def rest_error_calls
login_posts = "/api/v1/tickets/#{id(:login_ticket)}/posts"
{
diff --git a/spec/fixtures/mcp_contract.json b/spec/fixtures/mcp_contract.json
index 3b5906d..894def5 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": "c56a11b8820f9cb5f8d664fc9f0c433aedd30018",
+ "core_commit": "f21d59e33e5dbbe4f15365c6b7d6b429f11184f7",
"core_dirty": true,
- "contract_sha256": "463a72a9a78b957137b04184d6d5a5cc2c2a549412257495d5a72ae7ada865ac"
+ "contract_sha256": "ef502440d07806d550dca180a6bc947ab361a9f85a8155c19e26843f3875b230"
},
"contract": {
"mcp": {
@@ -4594,6 +4594,93 @@
}
}
}
+ },
+ "POST /api/v1/tickets/:ticket_id/posts": {
+ "html": {
+ "token": "write",
+ "request": {
+ "method": "POST",
+ "path": "/api/v1/tickets/00000000-0000-4000-8000-000000000041/posts",
+ "params": {
+ "post": {
+ "body": "<p>Ein <b>fetter</b> Satz &amp; mehr</p>"
+ }
+ }
+ },
+ "response": {
+ "status": 201,
+ "body": {
+ "data": {
+ "id": "<generated-id-8>",
+ "ticket_id": "00000000-0000-4000-8000-000000000041",
+ "author": {
+ "id": "00000000-0000-4000-8000-000000000011",
+ "name": "Anna Albers"
+ },
+ "body_html": "<p>Ein <b>fetter</b> Satz &amp; mehr</p>",
+ "body_text": "Ein fetter Satz & mehr",
+ "is_private": false,
+ "visible_to_user_id": null,
+ "created_at": "2026-01-05T09:36:00Z",
+ "updated_at": "2026-01-05T09:36:00Z"
+ }
+ }
+ }
+ },
+ "html_named": {
+ "token": "write",
+ "request": {
+ "method": "POST",
+ "path": "/api/v1/tickets/00000000-0000-4000-8000-000000000041/posts",
+ "params": {
+ "post": {
+ "format": "html",
+ "body": "<p>Noch ein <i>Satz</i></p>"
+ }
+ }
+ },
+ "response": {
+ "status": 201,
+ "body": {
+ "data": {
+ "id": "<generated-id-9>",
+ "ticket_id": "00000000-0000-4000-8000-000000000041",
+ "author": {
+ "id": "00000000-0000-4000-8000-000000000011",
+ "name": "Anna Albers"
+ },
+ "body_html": "<p>Noch ein <i>Satz</i></p>",
+ "body_text": "Noch ein Satz",
+ "is_private": false,
+ "visible_to_user_id": null,
+ "created_at": "2026-01-05T09:36:00Z",
+ "updated_at": "2026-01-05T09:36:00Z"
+ }
+ }
+ }
+ },
+ "html_empty": {
+ "token": "write",
+ "request": {
+ "method": "POST",
+ "path": "/api/v1/tickets/00000000-0000-4000-8000-000000000041/posts",
+ "params": {
+ "post": {
+ "body": ""
+ }
+ }
+ },
+ "response": {
+ "status": 422,
+ "body": {
+ "error": "validation_failed",
+ "code": "invalid_input",
+ "errors": [
+ "Content darf nicht leer sein"
+ ]
+ }
+ }
+ }
}
}
}