Summarize saved Wireshark4.x captures with enforced native resource limits, serialized admission, stable snapshot verification and retained fact/text pages. Preserve complete inventories within resource budgets and source uncertainty; report cleanup failure with partial Evidence and retained ownership. Verified six recorded corpora /13026 packets with independent Scapy/Python oracles, real CLI/MCP/schema parity,60 SNI names,132 DNS addresses and1000 URIs. Real TShark CI now exercises summary/paging. Actual Windows/Bun Wireshark remains unverified; macOS capture requires a separate enforceable-bound decision. Co-authored-by: 3QL <85309073+3QL@users.noreply.github.com> Co-authored-by: N0zoM1z0 <161784452+N0zoM1z0@users.noreply.github.com>
35 lines
1.3 KiB
TypeScript
35 lines
1.3 KiB
TypeScript
import { createEvidence } from "../evidence.js";
|
|
import { jsonObjectSchema, type JsonValue } from "../jsonValue.js";
|
|
import type { PcapRequest } from "./pcapAnalysis.js";
|
|
|
|
/** Domain facts needed by both successful and retained partial observations. */
|
|
interface PcapObservation {
|
|
readonly subject: Parameters<typeof createEvidence>[0] | null;
|
|
readonly provider: Parameters<typeof createEvidence>[1];
|
|
readonly result: JsonValue;
|
|
readonly rawResult: JsonValue | null;
|
|
readonly limitations: readonly string[];
|
|
readonly locations: NonNullable<
|
|
Parameters<typeof createEvidence>[2]["locations"]
|
|
>;
|
|
}
|
|
|
|
/** One owner commits packet aggregation provenance and caller intent into Evidence. */
|
|
export const createPcapEvidence = (
|
|
request: PcapRequest,
|
|
observation: PcapObservation,
|
|
) =>
|
|
createEvidence(observation.subject ?? undefined, observation.provider, {
|
|
operation: request.operation,
|
|
parameters: jsonObjectSchema.parse(request.input),
|
|
result: observation.result,
|
|
rawResult: observation.rawResult,
|
|
limitations: observation.limitations,
|
|
locations: observation.locations,
|
|
confidence:
|
|
request.operation === "inspect_pcap_capture" ? "derived" : "observed",
|
|
...(request.operation === "inspect_pcap_capture"
|
|
? { authority: "historical-reference" as const }
|
|
: {}),
|
|
});
|