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: resolve ticket view conflicts with main
Guido Boykeb72247e34f0e
diff --cc .github/workflows/guards.ymlindex ee9da43,782054e..502f9e6--- 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/ticket_view_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 CLAUDE.mdindex 1be296a,b962798..623db4a--- a/CLAUDE.md+++ b/CLAUDE.md@@@ -810,27 -809,6 +810,27 @@@ feature by feature)pinned against the routes both ways (`spec/requests/api/v1/capabilities_spec.rb`): a newendpoint adds its line there. Additive changes bump the minor.- **Ticket view** (REST R1, 2026-10-29, API 1.2.0):++**Ticket view** (REST R1, 2026-10-29, API 1.3.0):++* `GET /projects/:project_id/tickets` names `meta.available_statuses`, the project's status+ keys from the same source as MCP `list_tickets`.+* `GET /tickets/:id` takes opt-in pages: any one of `posts_page`, `posts_per_page` (at most+ 50, above is 422), `posts_order` (`oldest`, `newest`), `attachments_page` (10 per page)+ switches the answer to the paged fields of MCP `get_ticket` (`posts_total`,+ `posts_truncated`, `attachments`, ...). **Without them the body stays byte-equal** (the+ contract records it; gboyke/lalabase-mcp reads it). Invalid values: 422 `invalid_input`,+ checked before the ticket is looked up. A key without a value switches too. REST does not+ truncate bodies, nor the extracted `text` of attachments (up to 10 per page). These+ `attachments` are the ticket's own files only, with text and without URL (`attachments_total`+ counts those); `GET /tickets/:id/attachments` lists ticket and comment files with signed URLs.+* `GET /projects/:project_id/tickets/number/:number` answers what `GET /tickets/:id` answers,+ paging included. Missing, malformed (`abc`, `0`), unreadable, out of reach or foreign: the+ same 404. The number is looked up only inside that project.+* `GET /tickets/:ticket_id/posts/:id`: one readable comment, whole, in the shape of a comment+ in the ticket. Hidden private, foreign and missing comments: the same 404.+* Options and pages come from `Tickets::Reading`, shared with MCP `get_ticket`; MCP keeps its+ caps. Guard: `spec/requests/api/v1/ticket_view_spec.rb`.+`GET /api/v1/time_sessions/open` lists the person's own open hours within the token'sreach, organisations AND projects, and only the rows the web time list shows them(`TimeSessions::ViewingScope`). A booking on a ticket they cannot read keeps its row anddiff --cc app/services/api/v1/capabilities.rbindex 67c9e6c,3d0da2d..de3855f--- 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++ # the People API; 1.3.0 adds the REST ticket view (R1).++ API_VERSION = '1.3.0'# name => [verb, path as the router spells it]ENDPOINTS = {diff --cc spec/contracts/mcp_contract_recorder.rbindex b256692,cbef45f..6e98b1a--- a/spec/contracts/mcp_contract_recorder.rb+++ b/spec/contracts/mcp_contract_recorder.rb@@@ -468,39 -537,9 +537,42 @@@ module McpContrac# and the key reused with another body.'errors' => rest_error_calls,'idempotency' => rest_idempotency_calls,- # REST R1 (cli_rest_plan), appended last: the ticket view without MCP.+ # 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 R1: the ticket view without MCP.+ 'ticket_view' => rest_ticket_view_calls+ }+ end++ # Each request from its own line (Prosopite). `show` is the ticket without+ # 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, 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, 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)),+ 'post' => rest_get(:read, "#{login}/posts/#{id(:first_post)}"),+ 'post_not_found' => rest_get(:read, "#{login}/posts/#{id(:missing)}")}enddiff --cc spec/fixtures/mcp_contract.jsonindex 0b9658d,3b5906d..c00a714--- 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": "14fb8dae1789251791aa467a40e561067042e4c5",- "core_commit": "c56a11b8820f9cb5f8d664fc9f0c433aedd30018",++ "core_commit": "ce61484a85f94780cb44905b9389cdc6ef12b8c4","core_dirty": true,- "contract_sha256": "3b3dedf189048147ae11c6f632eba01cbe0f4bf444bda60a588e3265c2b3280a"- "contract_sha256": "463a72a9a78b957137b04184d6d5a5cc2c2a549412257495d5a72ae7ada865ac"++ "contract_sha256": "02d0ae3f56e787d7af48dc78b2fd116d45481737e099fe433e071c6ef51f3316"},"contract": {"mcp": {@@@ -2957,158 -3009,766 +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",- "posts.show",- "projects.list",- "projects.ticket_attribute_definitions",- "tickets.activities",- "tickets.attachments",- "tickets.by_number",- "tickets.create",- "tickets.list",- "tickets.paging",- "tickets.show",- "tickets.update",- "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",- "posts.show",- "projects.list",- "projects.ticket_attribute_definitions",- "tickets.activities",- "tickets.attachments",- "tickets.by_number",- "tickets.create",- "tickets.list",- "tickets.paging",- "tickets.show",- "tickets.update",- "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"+ "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"+ }+ }+ }}- }- }- },- "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",+ "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",++ "posts.show",+ "projects.list",+ "projects.ticket_attribute_definitions",+ "tickets.activities",+ "tickets.attachments",++ "tickets.by_number",+ "tickets.create",+ "tickets.list",++ "tickets.paging",+ "tickets.show",+ "tickets.update",+ "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",++ "posts.show",+ "projects.list",+ "projects.ticket_attribute_definitions",+ "tickets.activities",+ "tickets.attachments",++ "tickets.by_number",+ "tickets.create",+ "tickets.list",++ "tickets.paging",+ "tickets.show",+ "tickets.update",+ "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"}@@@ -3598,404 -4258,342 +4264,741 @@@}}},+ "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"+ }+ }+ }++ },+ "ticket_view": {+ "list": {+ "token": "read",+ "request": {+ "path": "/api/v1/projects/00000000-0000-4000-8000-000000000031/tickets?assignee=00000000-0000-4000-8000-000000000012"+ },+ "response": {+ "status": 200,+ "body": {+ "data": [+ {+ "id": "00000000-0000-4000-8000-000000000041",+ "number": 1,+ "title": "Login bricht ab",+ "status": "in_progress",+ "status_functions": [+ "is_in_progress"+ ],+ "ticket_type": "support",+ "parent_id": null,+ "assignees": [+ {+ "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"+ },+ "created_at": "2026-01-05T09:21:00Z",+ "updated_at": "2026-01-05T09:36:00Z"+ }+ ],+ "meta": {+ "page": 1,+ "per_page": 25,+ "total": 1,+ "available_statuses": [+ "new",+ "in_progress",+ "resolved",+ "closed",+ "backlog"+ ]+ }+ }+ }+ },+ "show": {+ "token": "read",+ "request": {+ "path": "/api/v1/tickets/00000000-0000-4000-8000-000000000042"+ },+ "response": {+ "status": 200,+ "body": {+ "data": {+ "id": "00000000-0000-4000-8000-000000000042",+ "number": 2,+ "title": "Export als CSV und XLSX",+ "status": "in_progress",+ "status_functions": [+ "is_in_progress"+ ],+ "ticket_type": "support",+ "parent_id": null,+ "assignees": [+ {+ "id": "00000000-0000-4000-8000-000000000011",+ "name": "Anna Albers"+ }+ ],+ "creator": {+ "id": "00000000-0000-4000-8000-000000000012",+ "name": "Ben Berger"+ },+ "created_at": "2026-01-05T09:22:00Z",+ "updated_at": "2026-01-05T09:36:00Z",+ "summary": null,+ "description_html": "Spalten wie in der Liste.",+ "description_text": "Spalten wie in der Liste.",+ "custom_attributes": {+ "status": "in_progress",+ "priority": "normal"+ },+ "project": {+ "id": "00000000-0000-4000-8000-000000000031",+ "name": "Website-Relaunch"+ },+ "posts": []+ },+ "permissions": {+ "is_account_admin": false,+ "tickets": {+ "read": true,+ "write": true+ },+ "documents": {+ "read": false,+ "write": false+ },+ "posts": {+ "can_create": true,+ "can_update_own": true,+ "can_destroy_own": true+ },+ "time_sessions": {+ "can_view_own": true,+ "can_view_all": false,+ "can_create_own": true,+ "can_edit_own": true,+ "can_edit_all": false,+ "can_delete_own": true,+ "can_delete_all": false+ },+ "activities": {+ "read": true+ }+ }+ }+ }+ },+ "show_paged": {+ "token": "read",+ "request": {+ "path": "/api/v1/tickets/00000000-0000-4000-8000-000000000041?posts_per_page=1&posts_page=2&attachments_page=1"+ },+ "response": {+ "status": 200,+ "body": {+ "data": {+ "id": "00000000-0000-4000-8000-000000000041",+ "number": 1,+ "title": "Login bricht ab",+ "status": "in_progress",+ "status_functions": [+ "is_in_progress"+ ],+ "ticket_type": "support",+ "parent_id": null,+ "assignees": [+ {+ "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"+ },+ "created_at": "2026-01-05T09:21: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ß.",+ "custom_attributes": {+ "status": "in_progress",+ "priority": "high"+ },+ "project": {+ "id": "00000000-0000-4000-8000-000000000031",+ "name": "Website-Relaunch"+ },+ "posts": [+ {+ "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"+ }+ ],+ "posts_total": 7,+ "posts_truncated": true,+ "posts_page": 2,+ "posts_per_page": 1,+ "posts_pages": 7,+ "posts_order": "oldest",+ "attachments": [+ {+ "id": "<generated-id-8>",+ "filename": "test_document.pdf",+ "content_type": "application/pdf",+ "byte_size": 452,+ "text": null,+ "text_status": "unavailable"+ }+ ],+ "attachments_total": 1,+ "attachments_truncated": false,+ "attachments_page": 1,+ "attachments_pages": 1+ },+ "permissions": {+ "is_account_admin": false,+ "tickets": {+ "read": true,+ "write": true+ },+ "documents": {+ "read": false,+ "write": false+ },+ "posts": {+ "can_create": true,+ "can_update_own": true,+ "can_destroy_own": true+ },+ "time_sessions": {+ "can_view_own": true,+ "can_view_all": false,+ "can_create_own": true,+ "can_edit_own": true,+ "can_edit_all": false,+ "can_delete_own": true,+ "can_delete_all": false+ },+ "activities": {+ "read": true+ }+ }+ }+ }+ },+ "show_invalid_paging": {+ "token": "read",+ "request": {+ "path": "/api/v1/tickets/00000000-0000-4000-8000-000000000041?posts_order=random"+ },+ "response": {+ "status": 422,+ "body": {+ "error": "invalid_input",+ "code": "invalid_input",+ "message": "invalid posts_order \"random\" (oldest or newest)"+ }+ }+ },+ "by_number": {+ "token": "read",+ "request": {+ "path": "/api/v1/projects/00000000-0000-4000-8000-000000000031/tickets/number/2"+ },+ "response": {+ "status": 200,+ "body": {+ "data": {+ "id": "00000000-0000-4000-8000-000000000042",+ "number": 2,+ "title": "Export als CSV und XLSX",+ "status": "in_progress",+ "status_functions": [+ "is_in_progress"+ ],+ "ticket_type": "support",+ "parent_id": null,+ "assignees": [+ {+ "id": "00000000-0000-4000-8000-000000000011",+ "name": "Anna Albers"+ }+ ],+ "creator": {+ "id": "00000000-0000-4000-8000-000000000012",+ "name": "Ben Berger"+ },+ "created_at": "2026-01-05T09:22:00Z",+ "updated_at": "2026-01-05T09:36:00Z",+ "summary": null,+ "description_html": "Spalten wie in der Liste.",+ "description_text": "Spalten wie in der Liste.",+ "custom_attributes": {+ "status": "in_progress",+ "priority": "normal"+ },+ "project": {+ "id": "00000000-0000-4000-8000-000000000031",+ "name": "Website-Relaunch"+ },+ "posts": []+ },+ "permissions": {+ "is_account_admin": false,+ "tickets": {+ "read": true,+ "write": true+ },+ "documents": {+ "read": false,+ "write": false+ },+ "posts": {+ "can_create": true,+ "can_update_own": true,+ "can_destroy_own": true+ },+ "time_sessions": {+ "can_view_own": true,+ "can_view_all": false,+ "can_create_own": true,+ "can_edit_own": true,+ "can_edit_all": false,+ "can_delete_own": true,+ "can_delete_all": false+ },+ "activities": {+ "read": true+ }+ }+ }+ }+ },+ "by_number_not_found": {+ "token": "read",+ "request": {+ "path": "/api/v1/projects/00000000-0000-4000-8000-000000000031/tickets/number/999"+ },+ "response": {+ "status": 404,+ "body": {+ "error": "not_found",+ "code": "not_found"+ }+ }+ },+ "by_number_hidden": {+ "token": "read",+ "request": {+ "path": "/api/v1/projects/00000000-0000-4000-8000-000000000033/tickets/number/1"+ },+ "response": {+ "status": 404,+ "body": {+ "error": "not_found",+ "code": "not_found"+ }+ }+ },+ "post": {+ "token": "read",+ "request": {+ "path": "/api/v1/tickets/00000000-0000-4000-8000-000000000041/posts/00000000-0000-4000-8000-000000000051"+ },+ "response": {+ "status": 200,+ "body": {+ "data": {+ "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"+ }+ }+ }+ },+ "post_not_found": {+ "token": "read",+ "request": {+ "path": "/api/v1/tickets/00000000-0000-4000-8000-000000000041/posts/00000000-0000-4000-8000-000000000999"+ },+ "response": {+ "status": 404,+ "body": {+ "error": "not_found",+ "code": "not_found"+ }+ }+ }}}}diff --cc spec/requests/api/v1/capabilities_spec.rbindex 1b5a6f0,8348aa0..65d9e2b--- 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,8 -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',- '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',+ 'tickets.by_number', 'posts.show', 'tickets.paging')end