For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (
- [ ]) syntax for tracking.
Goal: Keep the current expandable MTR UI, but remove mtrData from the normal packet-loss history list so large MTR blobs no longer inflate history requests or server memory.
Architecture: Split packet-loss history into two shapes. The existing history endpoint becomes a paginated summary feed with no mtrData. A new detail endpoint returns a single result, including mtrData, only when a user expands an MTR row. Add a composite index so summary history queries stop building temp sort state for common monitor history reads.
Tech Stack: Go, Gin, SQLite/Postgres SQL via squirrel, React, TanStack Query, TypeScript
- Modify:
/Users/soup/.codex/worktrees/4fd8/netronome/internal/types/types.goSummary packet-loss history type and detail type split. - Modify:
/Users/soup/.codex/worktrees/4fd8/netronome/internal/database/database.goDatabase service interface additions for summary/detail history reads. - Modify:
/Users/soup/.codex/worktrees/4fd8/netronome/internal/database/packetloss.goSummary query withoutmtr_data, single-result detail query withmtr_data. - Modify:
/Users/soup/.codex/worktrees/4fd8/netronome/internal/handlers/packetloss.goPaginated summary history endpoint and new detail endpoint. - Modify:
/Users/soup/.codex/worktrees/4fd8/netronome/internal/server/server.goRoute registration for new detail endpoint. - Add:
/Users/soup/.codex/worktrees/4fd8/netronome/internal/database/migrations/sqlite/021_packetloss_history_summary_index.sqlComposite index for packet-loss history ordering. - Add:
/Users/soup/.codex/worktrees/4fd8/netronome/internal/database/migrations/postgres/021_packetloss_history_summary_index_postgres.sqlPostgres equivalent index. - Modify:
/Users/soup/.codex/worktrees/4fd8/netronome/internal/database/packetloss_integration_test.goDatabase coverage for summary rows and detail fetch. - Modify:
/Users/soup/.codex/worktrees/4fd8/netronome/web/src/types/types.tsSplit summary history row from full detail row. - Modify:
/Users/soup/.codex/worktrees/4fd8/netronome/web/src/api/packetloss.tsPaginated summary fetch and detail fetch. - Modify:
/Users/soup/.codex/worktrees/4fd8/netronome/web/src/components/speedtest/packetloss/PacketLossMonitorDetails.tsxSummary history query wiring. - Modify:
/Users/soup/.codex/worktrees/4fd8/netronome/web/src/components/speedtest/packetloss/hooks/usePacketLossMonitorStatus.tsRefetch summary history only. - Modify:
/Users/soup/.codex/worktrees/4fd8/netronome/web/src/components/speedtest/packetloss/components/MonitorResultsTable.tsxLazy detail fetch per expanded row and pagination controls. - Modify:
/Users/soup/.codex/worktrees/4fd8/netronome/web/src/components/speedtest/packetloss/components/MTRResultsDisplay.tsxKeep rendering contract aligned with lazy-loaded detail data.
Files:
-
Modify:
/Users/soup/.codex/worktrees/4fd8/netronome/internal/types/types.go -
Modify:
/Users/soup/.codex/worktrees/4fd8/netronome/internal/database/database.go -
Modify:
/Users/soup/.codex/worktrees/4fd8/netronome/internal/database/packetloss.go -
Modify:
/Users/soup/.codex/worktrees/4fd8/netronome/internal/handlers/packetloss.go -
Modify:
/Users/soup/.codex/worktrees/4fd8/netronome/internal/server/server.go -
Modify:
/Users/soup/.codex/worktrees/4fd8/netronome/internal/database/packetloss_integration_test.go -
Add failing integration coverage for:
- summary history returns rows without
mtr_data - detail fetch returns
mtr_datafor one result - history endpoint pagination metadata is correct
- summary history returns rows without
-
Introduce dedicated summary/detail result types in Go so the history list is not forced to carry the blob field.
-
Replace
GetPacketLossResults(monitorID, limit)with:- paginated summary read ordered by newest first
- single-result detail read by result id + monitor id
-
Update the handler layer:
- existing
/packetloss/monitors/:id/historybecomes paginated summary-only - add
/packetloss/monitors/:id/history/:resultIdfor full detail
- existing
-
Update route registration and keep existing clients working only through the new response shape used by this branch.
-
Run focused backend tests for packet-loss database/handler behavior.
Files:
-
Add:
/Users/soup/.codex/worktrees/4fd8/netronome/internal/database/migrations/sqlite/021_packetloss_history_summary_index.sql -
Add:
/Users/soup/.codex/worktrees/4fd8/netronome/internal/database/migrations/postgres/021_packetloss_history_summary_index_postgres.sql -
Modify:
/Users/soup/.codex/worktrees/4fd8/netronome/internal/database/packetloss_integration_test.go -
Add a composite history index on
(monitor_id, created_at DESC)for both SQLite and Postgres. -
Extend integration coverage so history reads still return newest-first rows after migrations.
-
Run focused migration/integration tests for packet-loss database access.
Files:
-
Modify:
/Users/soup/.codex/worktrees/4fd8/netronome/web/src/types/types.ts -
Modify:
/Users/soup/.codex/worktrees/4fd8/netronome/web/src/api/packetloss.ts -
Modify:
/Users/soup/.codex/worktrees/4fd8/netronome/web/src/components/speedtest/packetloss/PacketLossMonitorDetails.tsx -
Modify:
/Users/soup/.codex/worktrees/4fd8/netronome/web/src/components/speedtest/packetloss/hooks/usePacketLossMonitorStatus.ts -
Modify:
/Users/soup/.codex/worktrees/4fd8/netronome/web/src/components/speedtest/packetloss/components/MonitorResultsTable.tsx -
Modify:
/Users/soup/.codex/worktrees/4fd8/netronome/web/src/components/speedtest/packetloss/components/MTRResultsDisplay.tsx -
Split packet-loss summary row typing from packet-loss detail typing in TypeScript.
-
Change the default history request to fetch paginated summary rows only.
-
Keep the current expandable MTR interaction, but lazy-load full detail when a row is expanded instead of parsing
mtrDatafrom the summary list. -
Preserve current summary UX:
- timestamps
- RTT metrics
- sent/recv
- mode badge
- hop count
-
Add simple page/load-more behavior on top of the paginated summary response instead of relying on one large result payload.
-
Run frontend lint after the TypeScript/API changes.
Files:
-
Review only
-
Run focused backend tests covering packet-loss history and migrations.
-
Run
pnpm -C web lint. -
Run one end-to-end manual smoke check:
- open packet-loss history
- confirm summary list renders without raw
mtrData - expand an MTR row
- confirm the hop-by-hop UI still renders from the new detail endpoint
-
Dispatch two parallel review subagents:
- Reviewer A:
gpt-5.4withhighreasoning, focused on backend/API/query correctness - Reviewer B:
gpt-5.4withhighreasoning, focused on frontend behavior/regression risk
- Reviewer A:
-
Resolve reviewer findings before final handoff.
-
Spec coverage:
- preserve current MTR UI behavior: covered in Task 3
- hard cutover away from blob-heavy history list: covered in Task 1
- reduce query memory pressure: covered in Task 2
- review against plan with two subagents: covered in Task 4
-
Placeholder scan:
- no
TODO/TBD - every task maps to concrete files and outcomes
- no
-
Type consistency:
- plan uses
summaryvsdetailterminology consistently across backend and frontend
- plan uses