Add packet-groups API endpoint for deduplicated packet list

- New GroupedPacketRead/PacketReceptionInfo/GroupedPacketList schemas
- GET /api/v1/packet-groups: two-phase GROUP BY query, 7-day default
  window, lightweight Phase 2 (no raw_hex/decoded), role-aware cache
- GET /api/v1/packet-groups/{hash}: full reception list with path_hashes
  extracted from decoded.payload.decoded.pathHashes
- New (packet_hash, received_at) composite index via Alembic migration
- i18n keys for receptions, path, observer counts

https://claude.ai/code/session_01NH2rZzuHzasJj12SZeRhbJ
This commit is contained in:
Claude committed 2026-06-13 07:48:40 +00:00
1 parent d12e209b8a
commit e3e7cb26da
6 files changed
+384 -1

No files matched your search

@@ -0,0 +1,30 @@
"""add packet_hash_received_at composite index
Revision ID: a1b2c3d4e5f6
Revises: e9f0c4079540
Create Date: 2026-06-13 07:30:00.000000+00:00
"""
from typing import Sequence, Union
from alembic import op
revision: str = "a1b2c3d4e5f6"
down_revision: Union[str, None] = "e9f0c4079540"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
with op.batch_alter_table("raw_packets", schema=None) as batch_op:
batch_op.create_index(
"ix_raw_packets_packet_hash_received_at",
["packet_hash", "received_at"],
unique=False,
)
def downgrade() -> None:
with op.batch_alter_table("raw_packets", schema=None) as batch_op:
batch_op.drop_index("ix_raw_packets_packet_hash_received_at")