Current coverage: `mcp/server` 78.8%, `mcp/proto` 0%, `mcp/session` 0%, `mcp/server/entity` 0%. Goal: all packages above 80%. **mcp/session (0% → 80%+)** - [ ] MCP-COV.1: Test `session.NewState` and state mutation methods #added:2026-03-15 - `NewState` returns initialized state with zero counters - `RecordToolCall` increments `ToolCalls` - `RecordAdd` increments per-type counter in `AddsPerformed` - `QueuePendingUpdate` appends to `PendingFlush` - `PendingCount` returns correct length - Verify multiple calls accumulate correctly **mcp/proto (0% → 80%+)** - [ ] MCP-COV.2: Test JSON marshaling/unmarshaling round-trips for proto types #added:2026-03-15 - `Request`, `Response`, `Notification`, `RPCError` - `InitializeParams` / `InitializeResult` - `CallToolParams` / `CallToolResult` - `GetPromptParams` / `GetPromptResult` - `ReadResourceParams` / `ReadResourceResult` - `SubscribeParams` / `UnsubscribeParams` - Verify field names match JSON tags, omitempty behaves correctly - [ ] MCP-COV.3: Test `ToolDefs` completeness and schema validity #added:2026-03-15 - Every tool in `ToolDefs` has non-empty Name, Description, InputSchema - InputSchema.Type is "object" for all tools - Required fields listed in schema are present in Properties - No duplicate tool names **mcp/server/entity (0% → 80%+)** - [ ] MCP-COV.4: Test `PromptDefs` completeness #added:2026-03-15 - Every prompt has non-empty Name and Description - Required arguments have non-empty Name and Description - No duplicate prompt names - Argument names match expected field constants **mcp/server gaps (78.8% → 85%+)** - [ ] MCP-COV.5: Test `promptAddLearning` (0% coverage) #added:2026-03-15 - Mirror the existing `promptAddDecision` test with learning-specific arguments (`content`, `context`, `lesson`, `application`) - [ ] MCP-COV.6: Test `toolRemind` (26.7% coverage) #added:2026-03-15 - Test with no reminders → returns no-reminders message - Test with active reminders → returns formatted list - Test with future-dated reminder → shows "not due" annotation - [ ] MCP-COV.7: Test `toolDrift` (57.1% coverage) #added:2026-03-15 - Test with clean context → status OK, no violations - Test with missing required files → violations reported - Test with context load failure → error response - [ ] MCP-COV.8: Test `toolComplete` error paths (66.7% coverage) #added:2026-03-15 - Empty query → error - Boundary violation → error - Non-matching query → error from `CompleteTask` - [ ] MCP-COV.9: Test `emitNotification` and `handleNotification` (both 0%) #added:2026-03-15 - `emitNotification` writes valid JSON-RPC notification to stdout - `handleNotification` for `notifications/initialized` returns nil - Unknown notification method returns nil (no-op) - [ ] MCP-COV.10: Test `writeError` (0% coverage) #added:2026-03-15 - Triggers on malformed JSON input (non-JSON-RPC) - Writes a valid JSON-RPC error response to stdout - [ ] MCP-COV.11: Test error paths for subscribe/unsubscribe (71.4%) #added:2026-03-15 - Invalid JSON params → `ErrCodeInvalidArg` - Empty URI → `ErrCodeInvalidArg`
Current coverage:
mcp/server78.8%,mcp/proto0%,mcp/session0%,mcp/server/entity0%. Goal: all packages above 80%.mcp/session (0% → 80%+)
session.NewStateand state mutation methods #added:2026-03-15NewStatereturns initialized state with zero countersRecordToolCallincrementsToolCallsRecordAddincrements per-type counter inAddsPerformedQueuePendingUpdateappends toPendingFlushPendingCountreturns correct lengthmcp/proto (0% → 80%+)
Request,Response,Notification,RPCErrorInitializeParams/InitializeResultCallToolParams/CallToolResultGetPromptParams/GetPromptResultReadResourceParams/ReadResourceResultSubscribeParams/UnsubscribeParamsToolDefscompleteness and schema validity #added:2026-03-15ToolDefshas non-empty Name, Description, InputSchemamcp/server/entity (0% → 80%+)
PromptDefscompleteness #added:2026-03-15mcp/server gaps (78.8% → 85%+)
promptAddLearning(0% coverage) #added:2026-03-15promptAddDecisiontest with learning-specificarguments (
content,context,lesson,application)toolRemind(26.7% coverage) #added:2026-03-15toolDrift(57.1% coverage) #added:2026-03-15toolCompleteerror paths (66.7% coverage) #added:2026-03-15CompleteTaskemitNotificationandhandleNotification(both 0%) #added:2026-03-15emitNotificationwrites valid JSON-RPC notification to stdouthandleNotificationfornotifications/initializedreturns nilwriteError(0% coverage) #added:2026-03-15ErrCodeInvalidArgErrCodeInvalidArg