fix+docs: channel_ids array, query keyword, glossary, transports, e2e tests#44
Merged
fix+docs: channel_ids array, query keyword, glossary, transports, e2e tests#44
Conversation
Backend /incident/list and /change/list expect channel_ids ([]int64), not channel_id (int). The singular field was silently dropped, causing the channel filter to leak incidents/changes from every channel. Renames the MCP tool parameter channel_id → channel_ids (comma-separated string), parsed via the existing parseCommaSeparatedInts helper, and supports filtering by multiple channels in one call. BREAKING: callers passing channel_id: <n> must switch to channel_ids: "<n>". Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ansports Replace "collaboration space" with "channel" in tool descriptions, parameter descriptions, and READMEs to match the canonical Flashduty glossary (flashduty-docs/glossary.md). User-facing strings only — wire-level identifiers, JSON tags, and MCP parameter names are unchanged. Also add a "Supported Transports" table to README.md / README_zh.md clarifying: - stdio: supported - Streamable HTTP (/mcp, /flashduty): supported - Standalone SSE (legacy GET /sse): not supported (server returns 405 by design) Adds TEST_PLAN_param_audit.md capturing the wider audit sweep that surfaced this glossary drift. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…d /team/list Backend input structs (fc-pgy/cmd/server/controller/member/member.go:38-45 and fc-pgy/cmd/server/controller/team/team.go:311-318) declare the search keyword field as 'query', not 'member_name'/'team_name'. Our previous payload was silently dropped, so name-based search returned all members/teams unfiltered. Wire-only fix; the MCP-side 'name' parameter and tool descriptions are unchanged. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4 tasks
Backend /member/list and /team/list expect the search keyword as 'query' (fc-pgy memberListInput.Query / listTeamInput.Query). The previous member_name / team_name keys were silently ignored so name-based filtering returned every member/team unfiltered.
Three new tests under the existing e2e build tag exercise the bugs fixed in this PR end-to-end against a real Flashduty cluster: - TestQueryIncidentsChannelFilter — picks the channel with the most recent incidents in an unfiltered query, then re-queries with channel_ids=that and asserts every returned incident matches. Catches the channel_id (singular) → channel_ids (array) wire-format bug. - TestQueryMembersNameFilter — pulls a substring from a real member's name (rune-aware so non-ASCII names work), filters with name=substring, asserts the result narrowed and each member matches. Catches the member_name → query bug. - TestQueryTeamsNameFilter — same shape as the members test against /team/list. The existing TestQueryIncidents/Members/Teams in the suite call the tools without filter args, so they could not have caught these bugs. Skips gracefully when there isn't enough data (no incidents in window, ≤1 member/team). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nsport # Conflicts: # pkg/flashduty/changes.go # pkg/flashduty/incidents.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Consolidated PR superseding #43 and #45. Five changes that all fall out of the same audit:
Bug fixes
1.
channel_idsarray (was singularchannel_id, silently dropped)query_incidentsandquery_changessentchannel_id(int) to the backend, but/incident/listand/change/listdeclarechannel_ids []int64. The unknown field was silently ignored, so the channel filter leaked results from every channel.channel_id→channel_ids(comma-separated string), parse via existingparseCommaSeparatedInts, sendchannel_ids: []intarray.channel_id: <n>must switch tochannel_ids: "<n>"(otherwise they keep getting unfiltered results — same bug as before, not a regression).2.
querykeyword (wasmember_name/team_name, silently dropped)query_members/query_teamssentmember_name/team_nameto/member/list//team/list, but fc-pgy declares the keyword field asquery. Filters silently ignored → name-based search returned every member/team.member_name/team_name→query. MCPnameparameter unchanged, no caller-facing break.Docs
3. Glossary alignment
flashduty-docs/glossary.md. User-facing strings only; no wire-level changes.person_idsand other wire-coupled identifiers deferred — see commit notes.4. Supported transports
WithDisableStreaming(true)ininternal/flashduty/server.go:346, see commit 5cfc840).Tests
5. e2e validation
e2e/fixes_validation_test.gowith three live-API regression tests (under existinge2ebuild tag) that would have caught both wire-format bugs:TestQueryIncidentsChannelFilter— picks a real channel from an unfiltered query, re-queries withchannel_ids, asserts every returned incident matches.TestQueryMembersNameFilter— picks a substring from a real member name (rune-aware for non-ASCII), filters, asserts the result narrowed and every member matches.TestQueryTeamsNameFilter— same shape against/team/list.Test plan
go build ./...— passes locally.TestIncidentLifecycle,TestUpdateIncident,TestIncidentQueryByTimeline) — running.rg -i "collaboration"returns zero hits.🤖 Generated with Claude Code