{"record":{"id":"b1acecf13107f236","repo":"paperclipai/paperclip","slug":"public-replay-contains-raw-call-evidence","errorCode":null,"errorMessage":"Public replay contains raw call evidence","messagePattern":"Public replay contains raw call evidence","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/paperclip-runner/scripts/public-eval-viewer.mjs","lineNumber":190,"sourceCode":"    \"runner\",\n    \"state\",\n    \"traceability\",\n    \"parity\",\n  ]) {\n    if (\n      !Array.isArray(payload.view.evidence?.[section]) ||\n      payload.view.evidence[section].length\n    )\n      throw new Error(\"Public replay contains unprojected evidence\");\n  }\n  for (const call of payload.view.evidence.calls) {\n    fields(\n      call,\n      \"id turnId operationId version providerRequest dispatchedCommand outcome result redactions threadAnchorId\",\n    );\n    fields(call.result, \"outcome detail\");\n    if (call.result.detail !== \"Tool payload withheld from public replay.\")\n      throw new Error(\"Public replay contains raw call evidence\");\n  }\n  for (const turn of payload.view.turns ?? []) {\n    fields(turn, \"id ordinal mode toolCallCount at stoppedByUser items\");\n    for (const item of turn.items ?? []) {\n      if (\n        ![\n          \"user_message\",\n          \"agent_message\",\n          \"tool_activity\",\n          \"system_notice\",\n        ].includes(item.kind)\n      )\n        throw new Error(\"Public replay contains an unprojected item\");\n      const shapes = {\n        user_message: \"kind id at author body streaming\",\n        agent_message: \"kind id at author body streaming\",\n        tool_activity:\n          \"kind id at operationId status summary input result evidenceRef\",","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/packages/paperclip-runner/scripts/public-eval-viewer.mjs#L172-L208","documentation":"Thrown by validatePublicChatPayload when a call entry in payload.view.evidence.calls has a result.detail other than the exact sentinel string 'Tool payload withheld from public replay.'. Call evidence in public replays must be stubbed with this redaction marker; any other detail means raw tool output leaked into the public artifact.","triggerScenarios":"Validating a payload where any view.evidence.calls[i].result.detail is not exactly the withheld-payload sentinel, or where result fields are missing/extra relative to the allowed 'outcome detail' shape.","commonSituations":"Building the public view without running the call redaction pass; copying internal call records (with real tool output) into the public JSON; a redaction change renaming the sentinel string.","solutions":["Run the call redaction pass that replaces each call.result with { outcome, detail: 'Tool payload withheld from public replay.' }.","Diff the offending call record against the redaction code path to see why the raw detail survived.","Regenerate the public replay from the internal run instead of editing it manually."],"exampleFix":"// before\ncall.result = { outcome: 'ok', detail: rawToolOutput };\n// after\ncall.result = { outcome: 'ok', detail: 'Tool payload withheld from public replay.' };","handlingStrategy":"type-guard","validationCode":"if (calls.some(c => c.result?.detail !== 'Tool payload withheld from public replay.')) throw new Error('raw call evidence present');","typeGuard":"function isRedactedCall(c) { return c?.result?.detail === 'Tool payload withheld from public replay.'; }","tryCatchPattern":"try { validatePublicChatPayload(payload); } catch (e) { if (e.message.includes('raw call evidence')) { console.error('call redaction step was skipped'); process.exit(1); } throw e; }","preventionTips":["Make call redaction an explicit pipeline stage that runs before serialization.","Assert the sentinel detail string in tests for every generated call record.","Keep the sentinel constant shared between producer and validator."],"tags":["validation","security","redaction"],"backgroundTag":"unexpected-response-shape","analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-09-10T03:14:50.855Z","contentChangedAt":"2026-09-10T03:14:50.855Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}