fix(perf): reject malformed PCAP provenance before grading

Parse present summary/page containers independently of the claimed kind so
malformed nested values write failed facts rather than crashing. Validate
outer limitations as arrays of strings before producing observations and
admitting citations. Preserve empty valid lists and original measurements.

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 0f24c61196
commit 620ac0f5a7
4 changed files with 30 additions and 6 deletions
@@ -525,6 +525,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 evidenceId = evidence.evidence_id;
if (typeof evidenceId !== "string" || !PCAP_EVIDENCE_ID.test(evidenceId))
throw new Error("PCAP Evidence receipt identity is missing or malformed");