Objective
Split pkg/cli/gateway_logs.go (1,066 lines) into concern-aligned files.
Context
Discussion: #26221
This file mixes four independent concerns: type definitions, RPC message parsing, gateway log parsing, MCP tool-call extraction, and aggregation.
Approach
gateway_logs_types.go — all type/struct definitions
gateway_logs_rpc.go — parseRPCMessages, findRPCMessagesPath, buildToolCallsFromRPCMessages
gateway_logs_parsing.go — parseGatewayLogs, processGatewayLogEntry, getOrCreateServer, getOrCreateTool
gateway_logs_aggregation.go — calculateGatewayAggregates, buildGuardPolicySummary
gateway_logs_mcp.go — extractMCPToolUsageData
Files to Modify
- Split:
pkg/cli/gateway_logs.go
- Create:
pkg/cli/gateway_logs_types.go
- Create:
pkg/cli/gateway_logs_rpc.go
- Create:
pkg/cli/gateway_logs_parsing.go
- Create:
pkg/cli/gateway_logs_aggregation.go
- Create:
pkg/cli/gateway_logs_mcp.go
Acceptance Criteria
Generated by Plan Command for issue #discussion #26221 · ● 150.1K · ◷
Objective
Split
pkg/cli/gateway_logs.go(1,066 lines) into concern-aligned files.Context
Discussion: #26221
This file mixes four independent concerns: type definitions, RPC message parsing, gateway log parsing, MCP tool-call extraction, and aggregation.
Approach
gateway_logs_types.go— all type/struct definitionsgateway_logs_rpc.go—parseRPCMessages,findRPCMessagesPath,buildToolCallsFromRPCMessagesgateway_logs_parsing.go—parseGatewayLogs,processGatewayLogEntry,getOrCreateServer,getOrCreateToolgateway_logs_aggregation.go—calculateGatewayAggregates,buildGuardPolicySummarygateway_logs_mcp.go—extractMCPToolUsageDataFiles to Modify
pkg/cli/gateway_logs.gopkg/cli/gateway_logs_types.gopkg/cli/gateway_logs_rpc.gopkg/cli/gateway_logs_parsing.gopkg/cli/gateway_logs_aggregation.gopkg/cli/gateway_logs_mcp.goAcceptance Criteria
gateway_logs.gois ≤ 300 lines (or removed if entirely replaced)make build && make test-unitpass without errorsmake fmt && make lintpass without errors