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.

fix: review round 2 of #124, pin the speaker count order and say where MCP types are checked

Guido Boykecfba0f60f64a
diff --git a/CLAUDE.md b/CLAUDE.md
index c531262..0ef5831 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -956,8 +956,10 @@ malformed one answer the same 404 (MCP `not_found`, also for a malformed id); `p
forms of its project first, outside the organisation or the token the same 404. `people` and
`speakers` only with the people right (`PersonPolicy`), named as the directory names them to the
reader; whom it does not list counts in `count` alone. No meeting, place or corrector in the
-answer. Pages by 50, at most 100, a value outside is a 400 (MCP `invalid_input`, the same text and
-after the same checks: the bounds are the reader's, not the tool schema's). Guards:
+answer. Pages by 50, at most 100, a whole number outside is a 400 (MCP `invalid_input`, the same text
+after the same checks: the bounds are the reader's, not the tool schema's). The types stay the schema's:
+a value of another type, `null` included, the MCP SDK refuses before any tool runs, in its own words,
+as for every tool. Guards:
`spec/requests/api/v1/terms_spec.rb`, `spec/requests/api/mcp_glossary_spec.rb`,
`spec/requests/api/glossary_parity_spec.rb` (REST and MCP answer the same),
`spec/services/glossary/lookup_spec.rb`.
diff --git a/app/services/lalabase/CLAUDE.md b/app/services/lalabase/CLAUDE.md
index c3dc937..08fc0be 100644
--- a/app/services/lalabase/CLAUDE.md
+++ b/app/services/lalabase/CLAUDE.md
@@ -51,6 +51,8 @@ Codebase-Verständnis.
so `project_filter?` stays false; an unknown argument is `invalid_input`. The bounds of `page` and
`per_page` are the reader's, not the schema's (no `minimum`/`maximum`): the SDK would refuse a value
ahead of the right and in its own English, where REST answers after the right in the owner's language.
+ The types stay the schema's: a value of another type (`null` included) the SDK refuses before the
+ tool, as it does for every tool.
On `:mcp` the same two names are twins (`McpFindPeople`, `McpGetPerson`, People S3b, MCP
0.13.0), own classes because their schema requires `organisation_id` (E3). `scope_mode
:token`; `PeopleTool.with_token_lookup` is their gate: only an organisation whose every
diff --git a/app/services/lalabase/tools/get_glossary.rb b/app/services/lalabase/tools/get_glossary.rb
index 8360cfa..dd74246 100644
--- a/app/services/lalabase/tools/get_glossary.rb
+++ b/app/services/lalabase/tools/get_glossary.rb
@@ -17,7 +17,9 @@ module Lalabase
# reorders, it does not narrow, so it is not the dispatcher's filter (project_filter? false).
# The bounds of page and per_page are the reader's, not the schema's (no minimum, no maximum):
# the SDK would refuse a value before the tool runs, ahead of the right and in its own English,
- # where REST refuses after the right in the owner's language (review round 1 of #124).
+ # where REST refuses after the right in the owner's language (review round 1 of #124). The types
+ # stay the schema's: a value of another type, null included, the SDK refuses before the tool runs,
+ # as for every tool (review round 2).
#
# MCP only, no assistant twin: the assistant does not need the glossary today.
class GetGlossary < Base
diff --git a/spec/services/glossary/lookup_spec.rb b/spec/services/glossary/lookup_spec.rb
index af6d92a..af190a8 100644
--- a/spec/services/glossary/lookup_spec.rb
+++ b/spec/services/glossary/lookup_spec.rb
@@ -334,6 +334,16 @@ RSpec.describe Glossary::Lookup, :ci_guard do
expect(tied.last[:speakers]).to eq([{ ref: "person:#{alma.id}", count: 2 }, { ref: "person:#{zeta.id}", count: 2 }])
end
+ # Review round 2 of #124: "member:" sorts before "person:", so here the count and the ref give
+ # opposite orders, and Ben is heard first.
+ it 'lists the speakers of a form most heard first, before the order of their refs' do
+ heard(quell, 'quell sprecher', replaced: 1, project: project, user: ben)
+ heard(quell, 'quell sprecher', replaced: 5, project: project, person: alma)
+
+ expect(forms(lookup.read, quell).first[:speakers])
+ .to eq([{ ref: "person:#{alma.id}", count: 5 }, { ref: "member:#{ben.id}", count: 1 }])
+ end
+
it 'lists the people by name, not in the order they were heard' do
heard(quell, 'quell z', project: project, person: zeta)
heard(quell, 'quell a', project: project, person: alma)