From e6cf2e354e5374ed3c3066b11b5768d2adaac178 Mon Sep 17 00:00:00 2001 From: N0zoM1z0 <161784452+N0zoM1z0@users.noreply.github.com> Date: Tue, 13 Oct 2026 18:27:23 +0000 Subject: [PATCH] fix(perf): authenticate PCAP receipts with the runtime owner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Validate complete, summary and page Evidence with the selected runtime’s existing authenticated parser before recording observations. Preserve the original envelope and remove duplicate outer shape/ID checks now owned by that parser. Keep task-specific capture/view semantics separate. Actual SDK before/after swapped-ID faults reproduce the false acceptance and verify rejection, with final complete/summary controls passing. All six original receipts from four real-model tasks independently authenticate against the pinned runtime. Pure factual-grader fixtures are not claimed as authentication evidence. Unchanged Python/comparator tests are not rerun. 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> --- experiments/analysis-efficiency/measure.mjs | 19 ++++++++++--------- .../pcap-small-captures.md | 9 +++++++++ 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/experiments/analysis-efficiency/measure.mjs b/experiments/analysis-efficiency/measure.mjs index 613fa6ca1..60dce4f80 100644 --- a/experiments/analysis-efficiency/measure.mjs +++ b/experiments/analysis-efficiency/measure.mjs @@ -524,15 +524,11 @@ const inspectEvmTarget = async () => { }; const PCAP_EVIDENCE_ID = /^ev_[a-f0-9]{64}$/u; -const pcapObservation = (evidence, requestedView) => { - if ( - !Array.isArray(evidence.limitations) || - !evidence.limitations.every((item) => typeof item === "string") - ) - throw new Error("PCAP Evidence lacks a valid limitations list"); +const pcapObservation = (evidence, requestedView, parseEvidence) => { + // Authenticate with the selected runtime's owner, preserving the original + // envelope for measurement and provenance rather than reconstructing it. + parseEvidence(evidence); const evidenceId = evidence.evidence_id; - if (typeof evidenceId !== "string" || !PCAP_EVIDENCE_ID.test(evidenceId)) - throw new Error("PCAP Evidence receipt identity is missing or malformed"); const value = normalized(evidence); for (const key of ["limitations", "unknowns"]) if ( @@ -609,6 +605,10 @@ const pcapObservation = (evidence, requestedView) => { }; }; const inspectPcapTarget = async () => { + const { parseEvidence } = await import( + pathToFileURL(resolve(values["runtime-root"], "dist/domain/evidence.js")) + .href + ); const input = { path: values.path, ...(values.delivery === "summary" ? { detail: "summary" } : {}), @@ -627,6 +627,7 @@ const inspectPcapTarget = async () => { pcapObservation( inspected, values.delivery === "summary" ? { kind: "summary" } : undefined, + parseEvidence, ), ]; let capture, uris; @@ -651,7 +652,7 @@ const inspectPcapTarget = async () => { view, }); const page = normalized(selected); - const observation = pcapObservation(selected, view); + const observation = pcapObservation(selected, view, parseEvidence); const total = capture.retained_counts.http_request_uris; const examined = Math.min(view.limit, total); const expectedCoverage = { diff --git a/experiments/analysis-efficiency/pcap-small-captures.md b/experiments/analysis-efficiency/pcap-small-captures.md index e36ff6456..88502a5ac 100644 --- a/experiments/analysis-efficiency/pcap-small-captures.md +++ b/experiments/analysis-efficiency/pcap-small-captures.md @@ -250,3 +250,12 @@ parent Evidence ID for both summary and page views. SDK acceptance and factual grading reject mismatches and missing digests while preserving complete deliveries. Before/after private actual-reply mutations verify both view roles; unmodified deliveries and four stored original-model factual regrades pass. + +The SDK observation boundary additionally authenticates each complete, summary +and page envelope with the selected runtime’s existing `parseEvidence` owner. +It preserves the original envelope, without duplicating semantic-ID hashing. +Format-valid swapped-ID mutations over actual SDK replies pass before this +guard and fail afterward; unmodified complete/summary controls pass. The model +grader tests selected facts against cited transcript receipts; its synthetic +fixtures do not establish Evidence authentication. The original real-model +receipts are independently authenticated against the pinned runtime.