paperclipai/paperclip · error · Error

Public protocol eval file exceeds its size boundary: ${file}

Error message

Public protocol eval file exceeds its size boundary: ${file}

What it means

Each allowlisted file in the public report is stat'ed and must be non-empty and at most 12 MiB (12 * 1024 * 1024 bytes). A zero-byte file or an oversized file aborts publication naming the file, guarding against truncated or bloated assets reaching the public host.

Source

Thrown at packages/paperclip-runner/scripts/publish-runner-protocol-eval-history.mjs:164

  const hasChat = files.some((file) =>
    /^attempts\/[^/]+\/index\.html$/.test(file),
  );
  const viewer = hasChat ? await trustedViewerFiles(viewerRoot) : null;
  if (!files.includes("index.html") || !files.includes("campaign.json")) {
    throw new Error(
      "Public protocol eval report requires index.html and campaign.json",
    );
  }
  for (const file of files) {
    if (!isPublicProtocolEvalPath(file)) {
      throw new Error(
        `Refusing non-allowlisted public protocol eval path ${file}`,
      );
    }
    const absolute = resolve(root, ...file.split("/"));
    const metadata = await stat(absolute);
    if (metadata.size === 0 || metadata.size > 12 * 1024 * 1024) {
      throw new Error(
        `Public protocol eval file exceeds its size boundary: ${file}`,
      );
    }
    if (file.startsWith("viewer/")) {
      const expected = viewer?.files.get(file);
      if (!expected || !expected.equals(await readFile(absolute)))
        throw new Error(
          `Public viewer asset differs from trusted build: ${file}`,
        );
      continue;
    }
    const content = await readFile(absolute, "utf8");
    const richAttempt = /^attempts\/[^/]+\/index\.html$/.test(file);
    const payload = richAttempt
      ? validatePublicViewerPage(content, viewer.index)
      : null;
    if (!richAttempt) {
      for (const pattern of CREDENTIAL_PATTERNS) {

View on GitHub (pinned to 01ad858492)

Solutions

  1. Inspect the named file: if empty, regenerate the report so it is written completely, then re-run.
  2. If the file is too large, shrink it (strip inline base64 images, link to hosted assets, split the page) so it is under 12 MiB.
  3. If large files are legitimately needed, raise the 12 MiB boundary in validatePublicProtocolEvalReport deliberately and document why.

Example fix

// before (file 14 MB with embedded base64 screenshots)
<img src="data:image/png;base64,...">
// after
<img src="https://cdn.example.com/shots/a1.png">  // file back under 12 MiB
Defensive patterns

Strategy: validation

Validate before calling

import { statSync } from 'node:fs';
const MAX = 12 * 1024 * 1024;
const offenders = allReportFiles(reportRoot)
  .map((f) => [f, statSync(`${reportRoot}/${f}`)])
  .filter(([, s]) => s.size === 0 || s.size > MAX);
if (offenders.length)
  throw new Error(`size-boundary violations: ${offenders.map(([f, s]) => `${f}=${s.size}`).join(', ')}`);

Try / catch

try {
  await publishReport(root);
} catch (err) {
  if (String(err.message).startsWith('Public protocol eval file exceeds its size boundary')) {
    console.error('Regenerate (empty file) or shrink (<12MiB) the named file:', err.message);
  } else throw err;
}

Prevention

When it happens

Trigger: Publishing when any allowlisted file is 0 bytes (interrupted write/disk-full) or larger than 12 MiB (an attempt HTML with embedded base64 screenshots, a huge campaign.json).

Common situations: Disk-full or killed build left an empty index.html; an attempt page embedded base64 images pushing past 12 MiB; campaign.json grew with accumulated history.

Understand the failure class

Background: "File too large" / "file size exceeds limit" errors: why libraries cap file sizes and how to fix them — this error's family across 46 libraries.

Related errors


AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-09-10). Data as JSON: /api/errors/265ff5947257d6c8. Report an issue: GitHub.