Skip to content

fix+docs: channel_ids array, query keyword, glossary, transports, e2e tests#44

Merged
ysyneu merged 7 commits intomainfrom
docs/glossary-and-transport
Apr 14, 2026
Merged

fix+docs: channel_ids array, query keyword, glossary, transports, e2e tests#44
ysyneu merged 7 commits intomainfrom
docs/glossary-and-transport

Conversation

@ysyneu
Copy link
Copy Markdown
Collaborator

@ysyneu ysyneu commented Apr 14, 2026

Consolidated PR superseding #43 and #45. Five changes that all fall out of the same audit:

Bug fixes

1. channel_ids array (was singular channel_id, silently dropped)

  • query_incidents and query_changes sent channel_id (int) to the backend, but /incident/list and /change/list declare channel_ids []int64. The unknown field was silently ignored, so the channel filter leaked results from every channel.
  • Fix: rename MCP param channel_idchannel_ids (comma-separated string), parse via existing parseCommaSeparatedInts, send channel_ids: []int array.
  • Breaking: callers passing channel_id: <n> must switch to channel_ids: "<n>" (otherwise they keep getting unfiltered results — same bug as before, not a regression).

2. query keyword (was member_name / team_name, silently dropped)

  • query_members / query_teams sent member_name / team_name to /member/list / /team/list, but fc-pgy declares the keyword field as query. Filters silently ignored → name-based search returned every member/team.
  • Fix: wire-only — request body keys member_name/team_namequery. MCP name parameter unchanged, no caller-facing break.

Docs

3. Glossary alignment

  • Replace "collaboration space" → "channel" in tool/parameter descriptions, toolset description, and READMEs to match flashduty-docs/glossary.md. User-facing strings only; no wire-level changes. person_ids and other wire-coupled identifiers deferred — see commit notes.

4. Supported transports

  • Add a clear table to README.md / README_zh.md: stdio ✅, Streamable HTTP ✅, standalone SSE ❌ (returns 405 by design — WithDisableStreaming(true) in internal/flashduty/server.go:346, see commit 5cfc840).

Tests

5. e2e validation

  • New e2e/fixes_validation_test.go with three live-API regression tests (under existing e2e build tag) that would have caught both wire-format bugs:
    • TestQueryIncidentsChannelFilter — picks a real channel from an unfiltered query, re-queries with channel_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.
  • All 9 existing read-only e2e tests pass against live API (no regression).
  • All 3 new validation tests pass against live API.
  • Mutation e2e tests (TestIncidentLifecycle, TestUpdateIncident, TestIncidentQueryByTimeline) — running.
  • rg -i "collaboration" returns zero hits.

🤖 Generated with Claude Code

ysyneu and others added 3 commits April 14, 2026 19:23
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>
Base automatically changed from fix/channel-ids-plural to main April 14, 2026 11:37
ysyneu and others added 3 commits April 14, 2026 19:40
The audit surfaced two real bugs (channel_ids in #43, query field in #45) and
a glossary drift fix (this PR). With those landing, the planning artifact has
served its purpose and shouldn't live in the repo.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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>
@ysyneu ysyneu changed the title docs: glossary alignment + supported transports section fix+docs: channel_ids array, query keyword, glossary, transports, e2e tests Apr 14, 2026
…nsport

# Conflicts:
#	pkg/flashduty/changes.go
#	pkg/flashduty/incidents.go
@ysyneu ysyneu merged commit b904459 into main Apr 14, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant