fix(experiments): reject reused PCAP page receipt IDs

Check page receipt uniqueness at the SDK workflow boundary before recording observations. A duplicate-ID injection over real MCP succeeds before the fix and fails after it without writing an answer; an unmodified real reply remains valid. Keep original measurements and production defaults 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>
This commit is contained in:
N0zoM1z0
2026-10-14 02:40:31 +08:00
committed by morluto
co-authored by factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> Kaoru0822
parent 6b167f9812
commit e5abf4acf4
2 changed files with 9 additions and 0 deletions
@@ -588,6 +588,8 @@ const inspectPcapTarget = async () => {
"PCAP page identity, scope or coverage differs from its parent", "PCAP page identity, scope or coverage differs from its parent",
); );
uris = page.page.items; uris = page.page.items;
if (observations.some((item) => item.evidence_id === selected.evidence_id))
throw new Error("PCAP retained read reused an Evidence identity");
observations.push(pcapObservation(selected)); observations.push(pcapObservation(selected));
} else { } else {
const { const {
@@ -146,6 +146,13 @@ injection setup loaded the separate CommonJS client and did not inject a fault;
that discarded setup attempt remains private alongside the corrected ESM runs. that discarded setup attempt remains private alongside the corrected ESM runs.
Original measured driver sources, token totals and timing data remain unchanged. Original measured driver sources, token totals and timing data remain unchanged.
The driver also requires a distinct Evidence receipt for the retained URI page.
A private SDK consumer injection reuses the summary's response ID after a real
MCP reply: the preceding driver accepts it, the corrected driver rejects it
without writing an answer, and an unmodified real reply still passes. This
checks receipt uniqueness before recording observations; it does not establish
that a provider actually returned duplicate IDs.
**Decision: keep existing complete defaults; add no production optimization.** **Decision: keep existing complete defaults; add no production optimization.**
For these compact recordings and this question, summary/page costs more total For these compact recordings and this question, summary/page costs more total
input in both real-model pairs. No stable speed or CPU/memory benefit justifies input in both real-model pairs. No stable speed or CPU/memory benefit justifies