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.
Ruby agplai-assistantdockerdsgvogdprhotwireissue-trackerjira-alternativeknowledge-basellmmcp-servermeeting-notesopen-sourceproject-managementredmine-alternativeruby-on-railsself-hostedticketingtime-tracking
merge: reconcile main and time booking API contracts
Guido Boyke8da6fd8e1a6e
diff --cc .github/workflows/guards.ymlindex 400d18b,782054e..1c31792--- a/.github/workflows/guards.yml+++ b/.github/workflows/guards.yml@@@ -291,7 -292,8 +292,9 @@@ jobsspec/requests/api/v1/error_codes_spec.rbspec/requests/api/v1/idempotency_spec.rbspec/requests/api/v1/capabilities_spec.rb+ spec/requests/api/v1/time_session_booking_spec.rb+ spec/requests/api/v1/people_spec.rb+ spec/requests/api/people_parity_spec.rbspec/models/codebase_import_mapping_spec.rbspec/services/codebase_import/time_session_importer_spec.rbspec/services/codebase_import/duplicate_prevention_spec.rbdiff --cc app/services/api/v1/capabilities.rbindex 181aa94,3d0da2d..ec85b4e--- a/app/services/api/v1/capabilities.rb+++ b/app/services/api/v1/capabilities.rb@@@ -14,8 -14,9 +14,9 @@@ module Apmodule V1module Capabilities# Minor for an additive change (a new endpoint, field or capability), major- # never: an existing name, field or meaning does not change.- # never: an existing name, field or meaning does not change. 1.2.0: people.list and- # people.show (People S3b).-- API_VERSION = '1.2.0'++ # never: an existing name, field or meaning does not change. 1.2.0 added++ # people.list and people.show; 1.3.0 adds time_sessions.book.++ API_VERSION = '1.3.0'# name => [verb, path as the router spells it]ENDPOINTS = {diff --cc app/services/lalabase/CLAUDE.mdindex efc7a7a,8d97736..8c12a01--- a/app/services/lalabase/CLAUDE.md+++ b/app/services/lalabase/CLAUDE.md@@@ -33,12 -45,11 +45,13 @@@ Codebase-VerständnisReichweite je Werkzeug (`Base.scope_mode`): `:project` (Default, Dispatcher injiziert`project_id` als Pflicht, ToolCall gated das Projekt) oder `:token` (Inbox-Arbeitsfluss:kein Projekt-Gate, `Context#reach` = `PersonalAccessToken::Reach`, läuft OHNE Tenant, nur- im `:mcp`-Set, record-mode; `list_notifications`, `mark_notification_read`). Die Inbox-+ im `:mcp`-Set, record-mode; `list_notifications`, `mark_notification_read`, und die+ Personen-Zwillinge, die sich den Tenant ihrer Organisation selbst setzen). Die Inbox-Zeilen kommen aus `Notifications::InboxQuery` + `Serializer`, geteilt mit der HTTP-API.Schreibende Werkzeuge gibt es nur im `:mcp`-Set: `create_ticket`, `post_comment`,- `create_time_session`, `mark_notification_read`, `update_ticket`. `post_comment` schreibt+ `create_time_session`, `mark_notification_read`, `update_ticket`. `create_time_session`+ bucht über `TimeSessions::Booking`, dieselbe Regel wie die HTTP-API (seit 29.10.2026,+ REST R6); im Werkzeug bleiben nur Argumente, Rechte und die Texte. `post_comment` schreibtüber `Actors::SavePost` wie das Web-Formular (Activity `post_added`, Benachrichtigungen,Embedding); ein nacktes `Post#save` löste bis zum 10.10.2026 nichts davon aus, in`Api::V1::PostsController` ebenso. `update_ticket`diff --cc spec/contracts/mcp_contract_recorder.rbindex b6c1254,cbef45f..f1f6456--- a/spec/contracts/mcp_contract_recorder.rb+++ b/spec/contracts/mcp_contract_recorder.rb@@@ -468,44 -537,9 +537,45 @@@ module McpContrac# and the key reused with another body.'errors' => rest_error_calls,'idempotency' => rest_idempotency_calls,- # REST R6, appended last: its bookings land on the login ticket after- # every answer above, without advancing the clock. Anna's time right on- # the website comes from time_report_calls; the archive has none.- # People S3b, appended last: the directory of people_world, made before the MCP calls.++ # People S3b: 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 R6 runs after the reads above, so its bookings do not change their answers.+ 'POST /api/v1/tickets/:ticket_id/time_sessions' => rest_booking_calls+ }+ end++ def rest_booking_calls+ # Spelled out, not a loop: each request from its own line (Prosopite).+ path = ->(ticket) { "/api/v1/tickets/#{id(ticket)}/time_sessions" }+ login = path.call(:login_ticket)+ once = { time_session: { duration_string: '0:15', description: 'Per REST, einmal.' } }+ key = 'contract-rest-book-1'+ {+ 'ok_minutes_text' => rest_send(:post, :write, login, params: { time_session: { duration_string: '30' } }),+ 'ok_hours_text' => rest_send(:post, :write, login,+ params: { time_session: { duration_string: '1:30', occurred_on: '2026-01-04',+ description: 'Vertrag' } }),+ 'ok_minutes' => rest_send(:post, :write, login, params: { time_session: { duration_minutes: 45 } }),+ 'invalid_input_no_duration' => rest_send(:post, :write, login, params: { time_session: { description: 'x' } }),+ 'invalid_input_both_durations' => rest_send(:post, :write, login,+ params: { time_session: { duration_string: '30',+ duration_minutes: 30 } }),+ 'invalid_input_date' => rest_send(:post, :write, login,+ params: { time_session: { duration_string: '30', occurred_on: '05.01.2026' } }),+ 'invalid_input_over_a_day' => rest_send(:post, :write, login, params: { time_session: { duration_string: '24:01' } }),+ 'not_found' => rest_send(:post, :write, path.call(:missing), params: { time_session: { duration_string: '30' } }),+ # No read access to the ticket: answered like a missing one.+ 'hidden' => rest_send(:post, :write, path.call(:hidden_ticket), params: { time_session: { duration_string: '30' } }),+ # Anna reads the archive's tickets but has no time right there.+ 'forbidden' => rest_send(:post, :write, path.call(:archived_ticket),+ params: { time_session: { duration_string: '30' } }),+ 'read_only' => rest_send(:post, :read, login, params: { time_session: { duration_string: '30' } }),+ 'idempotency_first' => rest_send(:post, :write, login, params: once, key: key),+ 'idempotency_replay' => rest_send(:post, :write, login, params: once, key: key),+ 'idempotency_mismatch' => rest_send(:post, :write, login, params: { time_session: { duration_string: '0:20' } },+ key: key),+ 'invalid_input_minutes' => rest_send(:post, :write, login, params: { time_session: { duration_minutes: '1.5' } })}enddiff --cc spec/fixtures/mcp_contract.jsonindex c49b9c5,3b5906d..5a7a81e--- a/spec/fixtures/mcp_contract.json+++ b/spec/fixtures/mcp_contract.json@@@ -1,9 -1,9 +1,9 @@@{"header": {"regenerate": "RAILS_ENV=test bin/rails mcp:contract",- "core_commit": "7a4c067e2cc7810252d636ba7871f7f6d946aa30",- "core_commit": "c56a11b8820f9cb5f8d664fc9f0c433aedd30018",++ "core_commit": "ac4a327109ba1c2002d9d11de87ca8c1afbbc175","core_dirty": true,- "contract_sha256": "a19edef526822bdabe6699a47c652bea958208ca3b476dfc92e2f45e613077c9"- "contract_sha256": "463a72a9a78b957137b04184d6d5a5cc2c2a549412257495d5a72ae7ada865ac"++ "contract_sha256": "769d6cf508f18e725ff509b17209895f01d536703266190ebdb9c2742905a4d7"},"contract": {"mcp": {@@@ -2957,158 -3009,770 +3009,772 @@@}}}- }- }- },- "rest": {- "GET /api/v1/me": {- "ok": {- "token": "write",- "request": {- "path": "/api/v1/me"- },- "response": {- "status": 200,- "body": {- "data": {- "user": {- "id": "00000000-0000-4000-8000-000000000011",- "email": "[email protected]",- "display_name": "Anna Albers"- },- "token": {- "id": "00000000-0000-4000-8000-000000000081",- "name": "Vertrag write_token",- "prefix": "lalab_pat_Wr",- "all_organisations": false,- "read_only": false,- "expires_at": "2026-02-04T09:34:00Z",- "last_used_at": "2026-01-05T09:36:00Z"- },- "scoped_organisations": [- {- "id": "00000000-0000-4000-8000-000000000001",- "name": "Nordlicht GmbH",- "all_projects": true+ },+ "find_people": {+ "ok": {+ "token": "read",+ "request": {+ "jsonrpc": "2.0",+ "id": 1,+ "method": "tools/call",+ "params": {+ "name": "find_people",+ "arguments": {+ "organisation_id": "00000000-0000-4000-8000-000000000001"+ }+ }+ },+ "response": {+ "status": 200,+ "body": {+ "jsonrpc": "2.0",+ "id": 1,+ "result": {+ "content": [+ {+ "type": "text",+ "text": "{\n \"total\": 3,\n \"truncated\": false,\n \"data\": [\n {\n \"id\": \"member:00000000-0000-4000-8000-000000000011\",\n \"name\": \"Anna Albers\",\n \"kind\": \"member\",\n \"function\": null,\n \"department\": null,\n \"company\": null,\n \"last_contact\": {\n \"on\": \"2026-01-05\",\n \"kind\": \"ticket\"\n }\n },\n {\n \"id\": \"member:00000000-0000-4000-8000-000000000012\",\n \"name\": \"Ben Berger\",\n \"kind\": \"member\",\n \"function\": \"Entwicklung\",\n \"department\": null,\n \"company\": null,\n \"last_contact\": null\n },\n {\n \"id\": \"person:00000000-0000-4000-8000-000000000091\",\n \"name\": \"Doris Dienstleister\",\n \"kind\": \"contact\",\n \"function\": \"Technische Ansprechpartnerin\",\n \"department\": \"Technik\",\n \"company\": \"Hosting AG\",\n \"last_contact\": null\n }\n ]\n}"+ }+ ],+ "isError": false,+ "_meta": {+ "lalabase/kind": "ok"}- ],- "api_version": "1.2.0",- "capabilities": [- "error_codes",- "idempotency",- "me.show",- "notifications.archive",- "notifications.list",- "notifications.mark_all_as_read",- "notifications.mark_as_read",- "organisations.list",- "posts.create",- "projects.list",- "projects.ticket_attribute_definitions",- "tickets.activities",- "tickets.attachments",- "tickets.create",- "tickets.list",- "tickets.show",- "tickets.update",- "time_sessions.book",- "time_sessions.create",- "time_sessions.list",- "time_sessions.open"- ]+ }}}- }- },- "ok_read_only": {- "token": "read",- "request": {- "path": "/api/v1/me"},- "response": {- "status": 200,- "body": {- "data": {- "user": {- "id": "00000000-0000-4000-8000-000000000011",- "email": "[email protected]",- "display_name": "Anna Albers"- },- "token": {- "id": "00000000-0000-4000-8000-000000000082",- "name": "Vertrag read_token",- "prefix": "lalab_pat_Rd",- "all_organisations": false,- "read_only": true,- "expires_at": "2026-02-04T09:35:00Z",- "last_used_at": "2026-01-05T09:36:00Z"- },- "scoped_organisations": [- {- "id": "00000000-0000-4000-8000-000000000001",- "name": "Nordlicht GmbH",- "all_projects": true+ "ok_query": {+ "token": "read",+ "request": {+ "jsonrpc": "2.0",+ "id": 1,+ "method": "tools/call",+ "params": {+ "name": "find_people",+ "arguments": {+ "organisation_id": "00000000-0000-4000-8000-000000000001",+ "query": "techn"+ }+ }+ },+ "response": {+ "status": 200,+ "body": {+ "jsonrpc": "2.0",+ "id": 1,+ "result": {+ "content": [+ {+ "type": "text",+ "text": "{\n \"total\": 1,\n \"truncated\": false,\n \"data\": [\n {\n \"id\": \"person:00000000-0000-4000-8000-000000000091\",\n \"name\": \"Doris Dienstleister\",\n \"kind\": \"contact\",\n \"function\": \"Technische Ansprechpartnerin\",\n \"department\": \"Technik\",\n \"company\": \"Hosting AG\",\n \"last_contact\": null\n }\n ]\n}"+ }+ ],+ "isError": false,+ "_meta": {+ "lalabase/kind": "ok"}- ],- "api_version": "1.2.0",- "capabilities": [- "error_codes",- "idempotency",- "me.show",- "notifications.archive",- "notifications.list",- "notifications.mark_all_as_read",- "notifications.mark_as_read",- "organisations.list",- "posts.create",- "projects.list",- "projects.ticket_attribute_definitions",- "tickets.activities",- "tickets.attachments",- "tickets.create",- "tickets.list",- "tickets.show",- "tickets.update",- "time_sessions.book",- "time_sessions.create",- "time_sessions.list",- "time_sessions.open"- ]+ }}}- }- },- "unauthorized": {- "token": "invalid",- "request": {- "path": "/api/v1/me"- },- "response": {- "status": 401,- "body": {- "error": "unauthorized",- "code": "unauthorized"- }- }- }- },- "GET /api/v1/organisations": {- "ok": {- "token": "read",- "request": {- "path": "/api/v1/organisations"},- "response": {- "status": 200,- "body": {- "data": [- {- "id": "00000000-0000-4000-8000-000000000001",- "name": "Nordlicht GmbH",- "subdomain": "nordlicht",- "scope": "all_projects"+ "ok_kind": {+ "token": "read",+ "request": {+ "jsonrpc": "2.0",+ "id": 1,+ "method": "tools/call",+ "params": {+ "name": "find_people",+ "arguments": {+ "organisation_id": "00000000-0000-4000-8000-000000000001",+ "kind": "members"}- ]+ }+ },+ "response": {+ "status": 200,+ "body": {+ "jsonrpc": "2.0",+ "id": 1,+ "result": {+ "content": [+ {+ "type": "text",+ "text": "{\n \"total\": 2,\n \"truncated\": false,\n \"data\": [\n {\n \"id\": \"member:00000000-0000-4000-8000-000000000011\",\n \"name\": \"Anna Albers\",\n \"kind\": \"member\",\n \"function\": null,\n \"department\": null,\n \"company\": null,\n \"last_contact\": {\n \"on\": \"2026-01-05\",\n \"kind\": \"ticket\"\n }\n },\n {\n \"id\": \"member:00000000-0000-4000-8000-000000000012\",\n \"name\": \"Ben Berger\",\n \"kind\": \"member\",\n \"function\": \"Entwicklung\",\n \"department\": null,\n \"company\": null,\n \"last_contact\": null\n }\n ]\n}"+ }+ ],+ "isError": false,+ "_meta": {+ "lalabase/kind": "ok"+ }+ }+ }+ }+ },+ "empty": {+ "token": "read",+ "request": {+ "jsonrpc": "2.0",+ "id": 1,+ "method": "tools/call",+ "params": {+ "name": "find_people",+ "arguments": {+ "organisation_id": "00000000-0000-4000-8000-000000000001",+ "query": "Gibt es nicht"+ }+ }+ },+ "response": {+ "status": 200,+ "body": {+ "jsonrpc": "2.0",+ "id": 1,+ "result": {+ "content": [+ {+ "type": "text",+ "text": "{\n \"total\": 0,\n \"truncated\": false,\n \"data\": [],\n \"next_step\": \"Nobody matches. Before saying so, try a shorter word stem (\\\"techn\\\" finds Technik and technisch), the company name or a surname, and leave kind out so that members and contacts are both searched.\"\n}"+ }+ ],+ "isError": false,+ "_meta": {+ "lalabase/kind": "ok"+ }+ }+ }+ }+ },+ "invalid_input": {+ "token": "read",+ "request": {+ "jsonrpc": "2.0",+ "id": 1,+ "method": "tools/call",+ "params": {+ "name": "find_people",+ "arguments": {+ "organisation_id": "oops"+ }+ }+ },+ "response": {+ "status": 200,+ "body": {+ "jsonrpc": "2.0",+ "id": 1,+ "result": {+ "content": [+ {+ "type": "text",+ "text": "invalid organisation_id \"oops\" (expected a UUID)"+ }+ ],+ "isError": true,+ "_meta": {+ "lalabase/code": "invalid_input"+ }+ }+ }+ }+ },+ "invalid_input_kind": {+ "token": "read",+ "request": {+ "jsonrpc": "2.0",+ "id": 1,+ "method": "tools/call",+ "params": {+ "name": "find_people",+ "arguments": {+ "organisation_id": "00000000-0000-4000-8000-000000000001",+ "kind": "member"+ }+ }+ },+ "response": {+ "status": 200,+ "body": {+ "jsonrpc": "2.0",+ "id": 1,+ "result": {+ "content": [+ {+ "type": "text",+ "text": "Invalid arguments: value at `/kind` is not one of: [\"all\", \"members\", \"contacts\"]"+ }+ ],+ "isError": true,+ "_meta": {+ "lalabase/code": "invalid_input"+ }+ }+ }+ }+ },+ "invalid_input_missing_argument": {+ "token": "read",+ "request": {+ "jsonrpc": "2.0",+ "id": 1,+ "method": "tools/call",+ "params": {+ "name": "find_people",+ "arguments": {}+ }+ },+ "response": {+ "status": 200,+ "body": {+ "jsonrpc": "2.0",+ "id": 1,+ "result": {+ "content": [+ {+ "type": "text",+ "text": "Missing required arguments: organisation_id"+ }+ ],+ "isError": true,+ "_meta": {+ "lalabase/code": "invalid_input"+ }+ }+ }+ }+ },+ "not_found": {+ "token": "read",+ "request": {+ "jsonrpc": "2.0",+ "id": 1,+ "method": "tools/call",+ "params": {+ "name": "find_people",+ "arguments": {+ "organisation_id": "00000000-0000-4000-8000-000000000002"+ }+ }+ },+ "response": {+ "status": 200,+ "body": {+ "jsonrpc": "2.0",+ "id": 1,+ "result": {+ "content": [+ {+ "type": "text",+ "text": "Organisation not found or not accessible."+ }+ ],+ "isError": true,+ "_meta": {+ "lalabase/code": "not_found"+ }+ }+ }+ }+ },+ "not_found_project_token": {+ "token": "limited",+ "request": {+ "jsonrpc": "2.0",+ "id": 1,+ "method": "tools/call",+ "params": {+ "name": "find_people",+ "arguments": {+ "organisation_id": "00000000-0000-4000-8000-000000000001"+ }+ }+ },+ "response": {+ "status": 200,+ "body": {+ "jsonrpc": "2.0",+ "id": 1,+ "result": {+ "content": [+ {+ "type": "text",+ "text": "Organisation not found or not accessible."+ }+ ],+ "isError": true,+ "_meta": {+ "lalabase/code": "not_found"+ }+ }+ }+ }+ },+ "refused": {+ "token": "dora",+ "request": {+ "jsonrpc": "2.0",+ "id": 1,+ "method": "tools/call",+ "params": {+ "name": "find_people",+ "arguments": {+ "organisation_id": "00000000-0000-4000-8000-000000000001"+ }+ }+ },+ "response": {+ "status": 200,+ "body": {+ "jsonrpc": "2.0",+ "id": 1,+ "result": {+ "content": [+ {+ "type": "text",+ "text": "The asking user may not see the people directory of this organisation. Say so, and do not guess names or contact details."+ }+ ],+ "isError": true,+ "_meta": {+ "lalabase/code": "refused",+ "lalabase/reason": "people_directory"+ }+ }+ }+ }+ }+ },+ "get_person": {+ "ok": {+ "token": "read",+ "request": {+ "jsonrpc": "2.0",+ "id": 1,+ "method": "tools/call",+ "params": {+ "name": "get_person",+ "arguments": {+ "organisation_id": "00000000-0000-4000-8000-000000000001",+ "id": "person:00000000-0000-4000-8000-000000000091"+ }+ }+ },+ "response": {+ "status": 200,+ "body": {+ "jsonrpc": "2.0",+ "id": 1,+ "result": {+ "content": [+ {+ "type": "text",+ "text": "{\n \"id\": \"person:00000000-0000-4000-8000-000000000091\",\n \"name\": \"Doris Dienstleister\",\n \"kind\": \"contact\",\n \"function\": \"Technische Ansprechpartnerin\",\n \"department\": \"Technik\",\n \"company\": \"Hosting AG\",\n \"last_contact\": null,\n \"salutation\": \"Frau\",\n \"email\": \"[email protected]\",\n \"phone\": \"+49 30 1234567\",\n \"additional_details\": [\n {\n \"label\": \"Mobil\",\n \"value\": \"+49 170 1234567\"\n }\n ]\n}"+ }+ ],+ "isError": false,+ "_meta": {+ "lalabase/kind": "ok"+ }+ }+ }+ }+ },+ "ok_member": {+ "token": "read",+ "request": {+ "jsonrpc": "2.0",+ "id": 1,+ "method": "tools/call",+ "params": {+ "name": "get_person",+ "arguments": {+ "organisation_id": "00000000-0000-4000-8000-000000000001",+ "id": "member:00000000-0000-4000-8000-000000000012"+ }+ }+ },+ "response": {+ "status": 200,+ "body": {+ "jsonrpc": "2.0",+ "id": 1,+ "result": {+ "content": [+ {+ "type": "text",+ "text": "{\n \"id\": \"member:00000000-0000-4000-8000-000000000012\",\n \"name\": \"Ben Berger\",\n \"kind\": \"member\",\n \"function\": \"Entwicklung\",\n \"department\": null,\n \"company\": null,\n \"last_contact\": null,\n \"salutation\": null,\n \"email\": \"[email protected]\",\n \"phone\": \"+49 30 7654321\",\n \"additional_details\": []\n}"+ }+ ],+ "isError": false,+ "_meta": {+ "lalabase/kind": "ok"+ }+ }+ }+ }+ },+ "empty": {+ "token": "read",+ "request": {+ "jsonrpc": "2.0",+ "id": 1,+ "method": "tools/call",+ "params": {+ "name": "get_person",+ "arguments": {+ "organisation_id": "00000000-0000-4000-8000-000000000001",+ "id": "person:00000000-0000-4000-8000-000000000999"+ }+ }+ },+ "response": {+ "status": 200,+ "body": {+ "jsonrpc": "2.0",+ "id": 1,+ "result": {+ "content": [+ {+ "type": "text",+ "text": "No person found for person:00000000-0000-4000-8000-000000000999. Use an id find_people returned."+ }+ ],+ "isError": false,+ "_meta": {+ "lalabase/kind": "empty"+ }+ }+ }+ }+ },+ "hidden": {+ "token": "read",+ "request": {+ "jsonrpc": "2.0",+ "id": 1,+ "method": "tools/call",+ "params": {+ "name": "get_person",+ "arguments": {+ "organisation_id": "00000000-0000-4000-8000-000000000001",+ "id": "member:00000000-0000-4000-8000-000000000014"+ }+ }+ },+ "response": {+ "status": 200,+ "body": {+ "jsonrpc": "2.0",+ "id": 1,+ "result": {+ "content": [+ {+ "type": "text",+ "text": "No person found for member:00000000-0000-4000-8000-000000000014. Use an id find_people returned."+ }+ ],+ "isError": false,+ "_meta": {+ "lalabase/kind": "empty"+ }+ }+ }+ }+ },+ "invalid_input": {+ "token": "read",+ "request": {+ "jsonrpc": "2.0",+ "id": 1,+ "method": "tools/call",+ "params": {+ "name": "get_person",+ "arguments": {+ "organisation_id": "00000000-0000-4000-8000-000000000001",+ "id": "abc"+ }+ }+ },+ "response": {+ "status": 200,+ "body": {+ "jsonrpc": "2.0",+ "id": 1,+ "result": {+ "content": [+ {+ "type": "text",+ "text": "invalid id (expected an id find_people returned, \"person:<uuid>\" or \"member:<uuid>\")"+ }+ ],+ "isError": true,+ "_meta": {+ "lalabase/code": "invalid_input"+ }+ }+ }+ }+ },+ "not_found": {+ "token": "read",+ "request": {+ "jsonrpc": "2.0",+ "id": 1,+ "method": "tools/call",+ "params": {+ "name": "get_person",+ "arguments": {+ "organisation_id": "00000000-0000-4000-8000-000000000002",+ "id": "person:00000000-0000-4000-8000-000000000091"+ }+ }+ },+ "response": {+ "status": 200,+ "body": {+ "jsonrpc": "2.0",+ "id": 1,+ "result": {+ "content": [+ {+ "type": "text",+ "text": "Organisation not found or not accessible."+ }+ ],+ "isError": true,+ "_meta": {+ "lalabase/code": "not_found"+ }+ }+ }+ }+ },+ "not_found_project_token": {+ "token": "limited",+ "request": {+ "jsonrpc": "2.0",+ "id": 1,+ "method": "tools/call",+ "params": {+ "name": "get_person",+ "arguments": {+ "organisation_id": "00000000-0000-4000-8000-000000000001",+ "id": "person:00000000-0000-4000-8000-000000000091"+ }+ }+ },+ "response": {+ "status": 200,+ "body": {+ "jsonrpc": "2.0",+ "id": 1,+ "result": {+ "content": [+ {+ "type": "text",+ "text": "Organisation not found or not accessible."+ }+ ],+ "isError": true,+ "_meta": {+ "lalabase/code": "not_found"+ }+ }+ }+ }+ },+ "refused": {+ "token": "dora",+ "request": {+ "jsonrpc": "2.0",+ "id": 1,+ "method": "tools/call",+ "params": {+ "name": "get_person",+ "arguments": {+ "organisation_id": "00000000-0000-4000-8000-000000000001",+ "id": "person:00000000-0000-4000-8000-000000000091"+ }+ }+ },+ "response": {+ "status": 200,+ "body": {+ "jsonrpc": "2.0",+ "id": 1,+ "result": {+ "content": [+ {+ "type": "text",+ "text": "The asking user may not see the people directory of this organisation. Say so, and do not guess names or contact details."+ }+ ],+ "isError": true,+ "_meta": {+ "lalabase/code": "refused",+ "lalabase/reason": "people_directory"+ }+ }+ }+ }+ }+ }+ }+ },+ "rest": {+ "GET /api/v1/me": {+ "ok": {+ "token": "write",+ "request": {+ "path": "/api/v1/me"+ },+ "response": {+ "status": 200,+ "body": {+ "data": {+ "user": {+ "id": "00000000-0000-4000-8000-000000000011",+ "email": "[email protected]",+ "display_name": "Anna Albers"+ },+ "token": {+ "id": "00000000-0000-4000-8000-000000000081",+ "name": "Vertrag write_token",+ "prefix": "lalab_pat_Wr",+ "all_organisations": false,+ "read_only": false,+ "expires_at": "2026-02-04T09:34:00Z",+ "last_used_at": "2026-01-05T09:36:00Z"+ },+ "scoped_organisations": [+ {+ "id": "00000000-0000-4000-8000-000000000001",+ "name": "Nordlicht GmbH",+ "all_projects": true+ }+ ],- "api_version": "1.2.0",++ "api_version": "1.3.0",+ "capabilities": [+ "error_codes",+ "idempotency",+ "me.show",+ "notifications.archive",+ "notifications.list",+ "notifications.mark_all_as_read",+ "notifications.mark_as_read",+ "organisations.list",+ "people.list",+ "people.show",+ "posts.create",+ "projects.list",+ "projects.ticket_attribute_definitions",+ "tickets.activities",+ "tickets.attachments",+ "tickets.create",+ "tickets.list",+ "tickets.show",+ "tickets.update",++ "time_sessions.book",+ "time_sessions.create",+ "time_sessions.list",+ "time_sessions.open"+ ]+ }+ }+ }+ },+ "ok_read_only": {+ "token": "read",+ "request": {+ "path": "/api/v1/me"+ },+ "response": {+ "status": 200,+ "body": {+ "data": {+ "user": {+ "id": "00000000-0000-4000-8000-000000000011",+ "email": "[email protected]",+ "display_name": "Anna Albers"+ },+ "token": {+ "id": "00000000-0000-4000-8000-000000000082",+ "name": "Vertrag read_token",+ "prefix": "lalab_pat_Rd",+ "all_organisations": false,+ "read_only": true,+ "expires_at": "2026-02-04T09:35:00Z",+ "last_used_at": "2026-01-05T09:36:00Z"+ },+ "scoped_organisations": [+ {+ "id": "00000000-0000-4000-8000-000000000001",+ "name": "Nordlicht GmbH",+ "all_projects": true+ }+ ],- "api_version": "1.2.0",++ "api_version": "1.3.0",+ "capabilities": [+ "error_codes",+ "idempotency",+ "me.show",+ "notifications.archive",+ "notifications.list",+ "notifications.mark_all_as_read",+ "notifications.mark_as_read",+ "organisations.list",+ "people.list",+ "people.show",+ "posts.create",+ "projects.list",+ "projects.ticket_attribute_definitions",+ "tickets.activities",+ "tickets.attachments",+ "tickets.create",+ "tickets.list",+ "tickets.show",+ "tickets.update",++ "time_sessions.book",+ "time_sessions.create",+ "time_sessions.list",+ "time_sessions.open"+ ]+ }+ }+ }+ },+ "unauthorized": {+ "token": "invalid",+ "request": {+ "path": "/api/v1/me"+ },+ "response": {+ "status": 401,+ "body": {+ "error": "unauthorized",+ "code": "unauthorized"+ }+ }+ }+ },+ "GET /api/v1/organisations": {+ "ok": {+ "token": "read",+ "request": {+ "path": "/api/v1/organisations"+ },+ "response": {+ "status": 200,+ "body": {+ "data": [+ {+ "id": "00000000-0000-4000-8000-000000000001",+ "name": "Nordlicht GmbH",+ "subdomain": "nordlicht",+ "scope": "all_projects"+ }+ ]}}},@@@ -3594,382 -4258,342 +4260,719 @@@}}},+ "GET /api/v1/organisations/:organisation_id/people": {+ "ok": {+ "token": "read",+ "request": {+ "path": "/api/v1/organisations/00000000-0000-4000-8000-000000000001/people"+ },+ "response": {+ "status": 200,+ "body": {+ "data": [+ {+ "id": "member:00000000-0000-4000-8000-000000000011",+ "name": "Anna Albers",+ "kind": "member",+ "function": null,+ "department": null,+ "company": null,+ "last_contact": {+ "on": "2026-01-05",+ "kind": "ticket"+ }+ },+ {+ "id": "member:00000000-0000-4000-8000-000000000012",+ "name": "Ben Berger",+ "kind": "member",+ "function": "Entwicklung",+ "department": null,+ "company": null,+ "last_contact": null+ },+ {+ "id": "person:00000000-0000-4000-8000-000000000091",+ "name": "Doris Dienstleister",+ "kind": "contact",+ "function": "Technische Ansprechpartnerin",+ "department": "Technik",+ "company": "Hosting AG",+ "last_contact": null+ }+ ],+ "meta": {+ "page": 1,+ "per_page": 50,+ "total": 3+ }+ }+ }+ },+ "ok_query": {+ "token": "read",+ "request": {+ "path": "/api/v1/organisations/00000000-0000-4000-8000-000000000001/people?q=techn"+ },+ "response": {+ "status": 200,+ "body": {+ "data": [+ {+ "id": "person:00000000-0000-4000-8000-000000000091",+ "name": "Doris Dienstleister",+ "kind": "contact",+ "function": "Technische Ansprechpartnerin",+ "department": "Technik",+ "company": "Hosting AG",+ "last_contact": null+ }+ ],+ "meta": {+ "page": 1,+ "per_page": 50,+ "total": 1+ }+ }+ }+ },+ "ok_paged": {+ "token": "read",+ "request": {+ "path": "/api/v1/organisations/00000000-0000-4000-8000-000000000001/people?kind=members&per_page=1&page=2"+ },+ "response": {+ "status": 200,+ "body": {+ "data": [+ {+ "id": "member:00000000-0000-4000-8000-000000000012",+ "name": "Ben Berger",+ "kind": "member",+ "function": "Entwicklung",+ "department": null,+ "company": null,+ "last_contact": null+ }+ ],+ "meta": {+ "page": 2,+ "per_page": 1,+ "total": 2+ }+ }+ }+ },+ "empty": {+ "token": "read",+ "request": {+ "path": "/api/v1/organisations/00000000-0000-4000-8000-000000000001/people?q=niemand"+ },+ "response": {+ "status": 200,+ "body": {+ "data": [],+ "meta": {+ "page": 1,+ "per_page": 50,+ "total": 0+ }+ }+ }+ },+ "invalid_input": {+ "token": "read",+ "request": {+ "path": "/api/v1/organisations/00000000-0000-4000-8000-000000000001/people?per_page=101"+ },+ "response": {+ "status": 400,+ "body": {+ "error": "bad_request",+ "code": "invalid_input",+ "message": "invalid per_page \"101\" (expected a whole number from 1 to 100)"+ }+ }+ },+ "invalid_input_kind": {+ "token": "read",+ "request": {+ "path": "/api/v1/organisations/00000000-0000-4000-8000-000000000001/people?kind=member"+ },+ "response": {+ "status": 400,+ "body": {+ "error": "bad_request",+ "code": "invalid_input",+ "message": "kind must be one of: all, members, contacts"+ }+ }+ },+ "forbidden": {+ "token": "dora",+ "request": {+ "path": "/api/v1/organisations/00000000-0000-4000-8000-000000000001/people"+ },+ "response": {+ "status": 403,+ "body": {+ "error": "forbidden",+ "code": "forbidden"+ }+ }+ },+ "not_found": {+ "token": "read",+ "request": {+ "path": "/api/v1/organisations/00000000-0000-4000-8000-000000000002/people"+ },+ "response": {+ "status": 404,+ "body": {+ "error": "not_found",+ "code": "not_found"+ }+ }+ },+ "not_found_project_token": {+ "token": "limited",+ "request": {+ "path": "/api/v1/organisations/00000000-0000-4000-8000-000000000001/people"+ },+ "response": {+ "status": 404,+ "body": {+ "error": "not_found",+ "code": "not_found"+ }+ }+ },+ "unauthorized": {+ "token": "invalid",+ "request": {+ "path": "/api/v1/organisations/00000000-0000-4000-8000-000000000001/people"+ },+ "response": {+ "status": 401,+ "body": {+ "error": "unauthorized",+ "code": "unauthorized"+ }+ }+ }+ },+ "GET /api/v1/organisations/:organisation_id/people/:id": {+ "ok": {+ "token": "read",+ "request": {+ "path": "/api/v1/organisations/00000000-0000-4000-8000-000000000001/people/person:00000000-0000-4000-8000-000000000091"+ },+ "response": {+ "status": 200,+ "body": {+ "data": {+ "id": "person:00000000-0000-4000-8000-000000000091",+ "name": "Doris Dienstleister",+ "kind": "contact",+ "function": "Technische Ansprechpartnerin",+ "department": "Technik",+ "company": "Hosting AG",+ "last_contact": null,+ "salutation": "Frau",+ "email": "[email protected]",+ "phone": "+49 30 1234567",+ "additional_details": [+ {+ "label": "Mobil",+ "value": "+49 170 1234567"+ }+ ],+ "notes": "Nur vormittags anrufen."+ }+ }+ }+ },+ "ok_member": {+ "token": "read",+ "request": {+ "path": "/api/v1/organisations/00000000-0000-4000-8000-000000000001/people/member:00000000-0000-4000-8000-000000000012"+ },+ "response": {+ "status": 200,+ "body": {+ "data": {+ "id": "member:00000000-0000-4000-8000-000000000012",+ "name": "Ben Berger",+ "kind": "member",+ "function": "Entwicklung",+ "department": null,+ "company": null,+ "last_contact": null,+ "salutation": null,+ "email": "[email protected]",+ "phone": "+49 30 7654321",+ "additional_details": [],+ "notes": null+ }+ }+ }+ },+ "not_found": {+ "token": "read",+ "request": {+ "path": "/api/v1/organisations/00000000-0000-4000-8000-000000000001/people/person:00000000-0000-4000-8000-000000000999"+ },+ "response": {+ "status": 404,+ "body": {+ "error": "not_found",+ "code": "not_found"+ }+ }+ },+ "hidden": {+ "token": "read",+ "request": {+ "path": "/api/v1/organisations/00000000-0000-4000-8000-000000000001/people/member:00000000-0000-4000-8000-000000000014"+ },+ "response": {+ "status": 404,+ "body": {+ "error": "not_found",+ "code": "not_found"+ }+ }+ },+ "invalid_input": {+ "token": "read",+ "request": {+ "path": "/api/v1/organisations/00000000-0000-4000-8000-000000000001/people/abc"+ },+ "response": {+ "status": 400,+ "body": {+ "error": "bad_request",+ "code": "invalid_input",+ "message": "invalid id (expected \"person:<uuid>\" or \"member:<uuid>\")"+ }+ }+ },+ "forbidden": {+ "token": "dora",+ "request": {+ "path": "/api/v1/organisations/00000000-0000-4000-8000-000000000001/people/person:00000000-0000-4000-8000-000000000091"+ },+ "response": {+ "status": 403,+ "body": {+ "error": "forbidden",+ "code": "forbidden"+ }+ }+ },+ "not_found_organisation": {+ "token": "read",+ "request": {+ "path": "/api/v1/organisations/00000000-0000-4000-8000-000000000002/people/person:00000000-0000-4000-8000-000000000091"+ },+ "response": {+ "status": 404,+ "body": {+ "error": "not_found",+ "code": "not_found"+ }+ }+ },+ "not_found_project_token": {+ "token": "limited",+ "request": {+ "path": "/api/v1/organisations/00000000-0000-4000-8000-000000000001/people/person:00000000-0000-4000-8000-000000000091"+ },+ "response": {+ "status": 404,+ "body": {+ "error": "not_found",+ "code": "not_found"+ }+ }+ }++ },+ "POST /api/v1/tickets/:ticket_id/time_sessions": {+ "ok_minutes_text": {+ "token": "write",+ "request": {+ "method": "POST",+ "path": "/api/v1/tickets/00000000-0000-4000-8000-000000000041/time_sessions",+ "params": {+ "time_session": {+ "duration_string": "30"+ }+ }+ },+ "response": {+ "status": 201,+ "body": {+ "data": {+ "id": "<generated-id-8>",+ "ticket_id": "00000000-0000-4000-8000-000000000041",+ "creator": {+ "id": "00000000-0000-4000-8000-000000000011",+ "name": "Anna Albers"+ },+ "occurred_on": "2026-01-05T00:00:00Z",+ "duration_minutes": 30,+ "description": null,+ "customer_description": null,+ "billed": false,+ "billed_at": null,+ "created_at": "2026-01-05T09:36:00Z"+ }+ }+ }+ },+ "ok_hours_text": {+ "token": "write",+ "request": {+ "method": "POST",+ "path": "/api/v1/tickets/00000000-0000-4000-8000-000000000041/time_sessions",+ "params": {+ "time_session": {+ "duration_string": "1:30",+ "occurred_on": "2026-01-04",+ "description": "Vertrag"+ }+ }+ },+ "response": {+ "status": 201,+ "body": {+ "data": {+ "id": "<generated-id-9>",+ "ticket_id": "00000000-0000-4000-8000-000000000041",+ "creator": {+ "id": "00000000-0000-4000-8000-000000000011",+ "name": "Anna Albers"+ },+ "occurred_on": "2026-01-04T00:00:00Z",+ "duration_minutes": 90,+ "description": "Vertrag",+ "customer_description": null,+ "billed": false,+ "billed_at": null,+ "created_at": "2026-01-05T09:36:00Z"+ }+ }+ }+ },+ "ok_minutes": {+ "token": "write",+ "request": {+ "method": "POST",+ "path": "/api/v1/tickets/00000000-0000-4000-8000-000000000041/time_sessions",+ "params": {+ "time_session": {+ "duration_minutes": 45+ }+ }+ },+ "response": {+ "status": 201,+ "body": {+ "data": {+ "id": "<generated-id-10>",+ "ticket_id": "00000000-0000-4000-8000-000000000041",+ "creator": {+ "id": "00000000-0000-4000-8000-000000000011",+ "name": "Anna Albers"+ },+ "occurred_on": "2026-01-05T00:00:00Z",+ "duration_minutes": 45,+ "description": null,+ "customer_description": null,+ "billed": false,+ "billed_at": null,+ "created_at": "2026-01-05T09:36:00Z"+ }+ }+ }+ },+ "invalid_input_no_duration": {+ "token": "write",+ "request": {+ "method": "POST",+ "path": "/api/v1/tickets/00000000-0000-4000-8000-000000000041/time_sessions",+ "params": {+ "time_session": {+ "description": "x"+ }+ }+ },+ "response": {+ "status": 422,+ "body": {+ "error": "validation_failed",+ "code": "invalid_input",+ "errors": [+ "Bitte geben Sie eine Dauer an (duration_string oder duration_minutes)."+ ]+ }+ }+ },+ "invalid_input_both_durations": {+ "token": "write",+ "request": {+ "method": "POST",+ "path": "/api/v1/tickets/00000000-0000-4000-8000-000000000041/time_sessions",+ "params": {+ "time_session": {+ "duration_string": "30",+ "duration_minutes": 30+ }+ }+ },+ "response": {+ "status": 422,+ "body": {+ "error": "validation_failed",+ "code": "invalid_input",+ "errors": [+ "Bitte geben Sie die Dauer entweder als duration_string oder als duration_minutes an, nicht beides."+ ]+ }+ }+ },+ "invalid_input_date": {+ "token": "write",+ "request": {+ "method": "POST",+ "path": "/api/v1/tickets/00000000-0000-4000-8000-000000000041/time_sessions",+ "params": {+ "time_session": {+ "duration_string": "30",+ "occurred_on": "05.01.2026"+ }+ }+ },+ "response": {+ "status": 422,+ "body": {+ "error": "validation_failed",+ "code": "invalid_input",+ "errors": [+ "Das Datum (occurred_on) ist kein ISO-8601-Datum und kein ISO-8601-Zeitstempel."+ ]+ }+ }+ },+ "invalid_input_over_a_day": {+ "token": "write",+ "request": {+ "method": "POST",+ "path": "/api/v1/tickets/00000000-0000-4000-8000-000000000041/time_sessions",+ "params": {+ "time_session": {+ "duration_string": "24:01"+ }+ }+ },+ "response": {+ "status": 422,+ "body": {+ "error": "validation_failed",+ "code": "invalid_input",+ "errors": [+ "Dauer darf höchstens 1440 Minuten (24 Stunden) betragen"+ ]+ }+ }+ },+ "not_found": {+ "token": "write",+ "request": {+ "method": "POST",+ "path": "/api/v1/tickets/00000000-0000-4000-8000-000000000999/time_sessions",+ "params": {+ "time_session": {+ "duration_string": "30"+ }+ }+ },+ "response": {+ "status": 404,+ "body": {+ "error": "not_found",+ "code": "not_found"+ }+ }+ },+ "hidden": {+ "token": "write",+ "request": {+ "method": "POST",+ "path": "/api/v1/tickets/00000000-0000-4000-8000-000000000043/time_sessions",+ "params": {+ "time_session": {+ "duration_string": "30"+ }+ }+ },+ "response": {+ "status": 404,+ "body": {+ "error": "not_found",+ "code": "not_found"+ }+ }+ },+ "forbidden": {+ "token": "write",+ "request": {+ "method": "POST",+ "path": "/api/v1/tickets/00000000-0000-4000-8000-000000000044/time_sessions",+ "params": {+ "time_session": {+ "duration_string": "30"+ }+ }+ },+ "response": {+ "status": 403,+ "body": {+ "error": "forbidden",+ "code": "forbidden"+ }+ }+ },+ "read_only": {+ "token": "read",+ "request": {+ "method": "POST",+ "path": "/api/v1/tickets/00000000-0000-4000-8000-000000000041/time_sessions",+ "params": {+ "time_session": {+ "duration_string": "30"+ }+ }+ },+ "response": {+ "status": 403,+ "body": {+ "error": "forbidden",+ "code": "read_only"+ }+ }+ },+ "idempotency_first": {+ "token": "write",+ "request": {+ "method": "POST",+ "path": "/api/v1/tickets/00000000-0000-4000-8000-000000000041/time_sessions",+ "params": {+ "time_session": {+ "duration_string": "0:15",+ "description": "Per REST, einmal."+ }+ },+ "idempotency_key": "contract-rest-book-1"+ },+ "response": {+ "status": 201,+ "body": {+ "data": {+ "id": "<generated-id-11>",+ "ticket_id": "00000000-0000-4000-8000-000000000041",+ "creator": {+ "id": "00000000-0000-4000-8000-000000000011",+ "name": "Anna Albers"+ },+ "occurred_on": "2026-01-05T00:00:00Z",+ "duration_minutes": 15,+ "description": "Per REST, einmal.",+ "customer_description": null,+ "billed": false,+ "billed_at": null,+ "created_at": "2026-01-05T09:36:00Z"+ }+ }+ }+ },+ "idempotency_replay": {+ "token": "write",+ "request": {+ "method": "POST",+ "path": "/api/v1/tickets/00000000-0000-4000-8000-000000000041/time_sessions",+ "params": {+ "time_session": {+ "duration_string": "0:15",+ "description": "Per REST, einmal."+ }+ },+ "idempotency_key": "contract-rest-book-1"+ },+ "response": {+ "status": 201,+ "body": {+ "data": {+ "id": "<generated-id-11>",+ "ticket_id": "00000000-0000-4000-8000-000000000041",+ "creator": {+ "id": "00000000-0000-4000-8000-000000000011",+ "name": "Anna Albers"+ },+ "occurred_on": "2026-01-05T00:00:00Z",+ "duration_minutes": 15,+ "description": "Per REST, einmal.",+ "customer_description": null,+ "billed": false,+ "billed_at": null,+ "created_at": "2026-01-05T09:36:00Z"+ }+ }+ }+ },+ "idempotency_mismatch": {+ "token": "write",+ "request": {+ "method": "POST",+ "path": "/api/v1/tickets/00000000-0000-4000-8000-000000000041/time_sessions",+ "params": {+ "time_session": {+ "duration_string": "0:20"+ }+ },+ "idempotency_key": "contract-rest-book-1"+ },+ "response": {+ "status": 422,+ "body": {+ "error": "idempotency_key_reused",+ "code": "invalid_input",+ "message": "idempotency_key already used with different parameters"+ }+ }+ },+ "invalid_input_minutes": {+ "token": "write",+ "request": {+ "method": "POST",+ "path": "/api/v1/tickets/00000000-0000-4000-8000-000000000041/time_sessions",+ "params": {+ "time_session": {+ "duration_minutes": "1.5"+ }+ }+ },+ "response": {+ "status": 422,+ "body": {+ "error": "validation_failed",+ "code": "invalid_input",+ "errors": [+ "Bitte geben Sie duration_minutes als ganze Zahl von Minuten an."+ ]+ }+ }+ }}}}diff --cc spec/requests/api/v1/capabilities_spec.rbindex 6df8f4c,8348aa0..a38ba6d--- a/spec/requests/api/v1/capabilities_spec.rb+++ b/spec/requests/api/v1/capabilities_spec.rb@@@ -33,7 -33,7 +33,7 @@@ RSpec.describe 'API V1 capabilities', :it 'names the API version and the capabilities beside the existing fields' dodata = me(token(read_only: false))-- expect(data['api_version']).to eq('1.2.0')++ expect(data['api_version']).to eq('1.3.0')expect(data['capabilities']).to eq(Api::V1::Capabilities.names)expect(data.keys).to include('user', 'token', 'scoped_organisations')end@@@ -46,7 -46,7 +46,8 @@@expect(Api::V1::Capabilities.names).to include('me.show', 'organisations.list', 'projects.list', 'tickets.list', 'tickets.create', 'tickets.show','tickets.update', 'tickets.attachments', 'posts.create', 'time_sessions.create',- 'notifications.list', 'notifications.mark_as_read', 'idempotency', 'error_codes', 'time_sessions.book'- 'notifications.list', 'notifications.mark_as_read', 'people.list', 'people.show', 'idempotency', 'error_codes'++ 'notifications.list', 'notifications.mark_as_read', 'people.list', 'people.show', 'idempotency', 'error_codes',++ 'time_sessions.book')end