Files
rea/experiments/analysis-efficiency/packet-model-prompt.mjs
ca7450beff test(perf): evaluate larger and non-HTTP packet workflows (#3232)
Add reproducible larger/non-HTTP packet cost measurements, an independent header oracle, exact page validation and separate factual/plan grading. Document caller-selected controls and retain negative/mixed model results. Production defaults and APIs remain unchanged.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
2026-10-14 16:18:22 +08:00

41 lines
1.1 KiB
JavaScript

import { readFile } from "node:fs/promises";
import { parseArgs } from "node:util";
import { packetRequest } from "./packet-entry.mjs";
const { values } = parseArgs({ options: { selection: { type: "string" } } });
if (!["baseline", "focused", "discovery"].includes(values.selection))
throw new Error("Select baseline, focused or discovery");
const question = await readFile(
new URL("./questions/packet-postgres.txt", import.meta.url),
"utf8",
);
const plan = [
...(values.selection === "discovery"
? [
{
tool: "inspect_packet_fields",
arguments: {
kind: "fields",
protocol: "tcp",
query: "tcp.flags",
limit: 1,
},
},
]
: []),
{
tool: "inspect_packet_capture",
arguments: packetRequest(
"wireshark-pgsql-jdbc.pcap",
"{{artifact_path}}",
values.selection,
),
},
];
process.stdout.write(
question +
"\nExecute this fixed public REA MCP plan in order. These are input selections, not expected answers. Preserve omitted defaults. All calls count toward the comparison.\n" +
JSON.stringify(plan, null, 2) +
"\n",
);