PacketScope is local-first, deterministic, bounded and evidence-oriented. The core analysis engine does not depend on the web UI and the same result model is used by CLI, API, reports and tests.
- Capture reader validates PCAP/PCAPNG block/header bounds and emits
PacketRecordobjects. - Protocol parser decodes supported link/network/transport/application metadata without executing capture content.
- Normalizer adds 1-based packet IDs and builds bounded event collections.
- Flow engine creates directional flows and canonical bidirectional conversations.
- TCP reconstruction sorts sequence-numbered payload segments, handles overlap/retransmission bytes and stops at missing gaps.
- Correlation pairs DNS queries/responses, HTTP requests/responses and TLS handshake directions where metadata is available.
- Host profiler attributes bytes, protocols, destinations, domains/SNI and findings to endpoints.
- Graph builder emits host traffic plus DNS/TLS-name pivots for the frontend.
- Detection engine evaluates metadata heuristics, applies allowlists/suppressions and computes a confidence-weighted risk score.
- Workspace stores local capture/result/annotations under a random session ID and creates PCAPNG evidence slices from finding packet IDs.
Defaults in AnalysisLimits constrain packets, normalized events, protocol records, flows, streams, stream bytes and evidence packet-ID lists. Web uploads are separately size-limited.
The intent is graceful degradation on large/untrusted captures rather than unbounded in-memory retention.
Every parsed normalized event receives a 1-based packet_id. Detections retain bounded packet-ID references inside finding.evidence.packet_ids. Slicing re-reads the original capture and writes only those records to a new PCAPNG file, preserving timestamps, original lengths and link types.
The capture SHA-256 is calculated before result delivery and included as capture.sha256 with a short evidence_id.
PacketScope reconstruction is directional and intentionally conservative:
- sequence-sort segments
- accept new contiguous bytes
- account for retransmitted/overlapping bytes
- stop at the first positive sequence gap
- never insert placeholder data for missing bytes
- cap reconstructed bytes per stream
This provides enough context for split HTTP/TLS headers without claiming full TCP-stack equivalence.
Frontend assets and the synthetic demo are package data under packetscope/web and packetscope/sample_data. An installed wheel therefore retains the web workbench instead of depending on repository-relative files.