{
  "assessment": {
    "decisions": [
      {
        "decided_by": "locality",
        "defect_id": "13",
        "finding_id": "f1",
        "id": "d1",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "17",
        "finding_id": "f2",
        "id": "d2",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "12",
        "finding_id": "f3",
        "id": "d3",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "11",
        "finding_id": "f4",
        "id": "d4",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "2",
        "finding_id": "f5",
        "id": "d5",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "7",
        "finding_id": "f6",
        "id": "d6",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "6",
        "finding_id": "f7",
        "id": "d7",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "4",
        "finding_id": "f8",
        "id": "d8",
        "outcome": "matched",
        "reason": null
      }
    ],
    "judge": null,
    "judged": false,
    "scorer": {
      "commit": "a7aa25027b6edfbb2a50b13e24d995fdd4f95ca8",
      "digest": "sha256:a1a935298956020ee6d767a756847abb4c00694c88c2eb80d454886ebc4acf8c",
      "id": "bench-score",
      "version": "1"
    },
    "state": "measured"
  },
  "benchmark": {
    "input_fingerprint": "69301578538a",
    "key_fingerprint": "bd331c0b144e",
    "policy_fingerprint": "c53f8cfc8c75",
    "prompt_fingerprint": "74234e98afe7",
    "subject": "proxy"
  },
  "build": {
    "commit": "b0f313c0b59a66ecc7612396dc8db0ea5da13a7a",
    "digest": null,
    "dirty": false,
    "label": "afi 0.30.0",
    "version": "0.30.0"
  },
  "configuration": {
    "fingerprint": "be7c5b1aa470",
    "label": "default",
    "models": [
      {
        "effort": "high",
        "model": "z-ai/glm-5.3-flash",
        "protocol": null,
        "provider": "z-ai",
        "role": "agent"
      }
    ],
    "profile": null,
    "resolved": {
      "effort": "high",
      "instructions": [],
      "sandbox": {
        "backend": "macOS Seatbelt",
        "mode": "read-only",
        "network": "denied"
      },
      "source": "openrouter",
      "system_prompt": {
        "file": null,
        "mode": "builtin"
      },
      "tools": [
        "read_file",
        "write_file",
        "edit_file",
        "list_dir",
        "search_files",
        "glob_files",
        "run_bash",
        "wait_background"
      ]
    }
  },
  "coverage": {
    "chunks": null,
    "files_failed": 0,
    "files_kept": null,
    "files_skipped": 0,
    "files_unreviewed": 0,
    "hunks": null,
    "state": "measured"
  },
  "evidence": [
    {
      "digest": "sha256:b6f41cb0f9caad4e423657ce4edbac200cc01c9b8cff8e16ff47ef5f682394cf",
      "media_type": "application/json",
      "path": "summary.json",
      "role": "summary"
    },
    {
      "digest": "sha256:b11718eaf8f412cd9b6a1d49411361699cf3de2e6eadf1519c5b6b4253d90b22",
      "media_type": "application/json",
      "path": "findings.json",
      "role": "findings"
    },
    {
      "digest": "sha256:0503392cfafb85d7a157bc0f598b5e4fca95acacb570721519f69b1f5aabccbf",
      "media_type": "application/json",
      "path": "meta.json",
      "role": "meta"
    },
    {
      "digest": "sha256:7d62da0e1842a0c80e2ca8f7bd7045a74cc2d47aa077cbb95a35867ec098fbaa",
      "media_type": "application/json",
      "path": "spend.json",
      "role": "spend"
    },
    {
      "digest": "sha256:f16ae5cf74e8b61d6e611f107692d4cc5a9ee2be9f5547d6b3b3018425497ae2",
      "media_type": "application/jsonl",
      "path": "result.jsonl",
      "role": "result"
    },
    {
      "digest": "sha256:bc87e8f8de7c0d6e391e8a6459c5f89c0ef246c0ad3176e978f5bb90992b2e61",
      "media_type": "text/plain",
      "path": "stderr.txt",
      "role": "stderr"
    },
    {
      "digest": "sha256:e7f58a21b1f0efc742eb96f1c4ef610e3a19bc93258dc2f062fb0a94f1a1d25e",
      "media_type": "application/gzip",
      "path": "afi-home/logs.tar.gz",
      "role": "traffic"
    }
  ],
  "execution": {
    "billing_limit_usd": 2.0,
    "budget_usd": null,
    "deadline_exceeded": false,
    "exit_code": 0,
    "finished_at": "2026-08-31T17:58:36Z",
    "started_at": "2026-08-31T17:56:52Z",
    "wall_seconds": 104.0
  },
  "extensions": {
    "afi": {
      "found_per_pass": {
        "agent": 8
      },
      "passes": null,
      "review_seconds": 102.799,
      "tier1_only": false,
      "variant_hash": null
    }
  },
  "findings": {
    "items": [
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "values()` returns `sweep_bytes_reclaimed` before `sweep_blobs_removed`, but `COUNTERS` (lines 51-57) lists `cairn_proxy_sweep_blobs_removed_total` first \u2014 `render()` zips them in order, so every\u2026\n\nvalues()` returns `sweep_bytes_reclaimed` before `sweep_blobs_removed`, but `COUNTERS` (lines 51-57) lists `cairn_proxy_sweep_blobs_removed_total` first \u2014 `render()` zips them in order, so every scrape publishes the byte count under the blobs-removed name and vice versa; any alert or dashboard built on the documented counter names reads the wrong quantity.",
        "id": "f1",
        "locations": [
          {
            "end_line": 94,
            "path": "services/proxy/src/metrics.rs",
            "start_line": 94
          }
        ],
        "severity": "bug",
        "title": "bug"
      },
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "clear_partials` unlinks every file in `incoming` with no age or ownership check, but `BlobStore::writer` (store.rs:171-180) puts the temp file of every *in-flight* fetch there \u2014 a sweep concurrent\u2026\n\nclear_partials` unlinks every file in `incoming` with no age or ownership check, but `BlobStore::writer` (store.rs:171-180) puts the temp file of every *in-flight* fetch there \u2014 a sweep concurrent with any active download unlinks its temp, so the fetch's `commit` rename fails (store.rs:259) and the download errors out; the \"a file in `incoming` is a fetch that is not coming back\" premise is false for live writers, and `CAIRN_CACHE_MIN_AGE` is not honoured here either.",
        "id": "f2",
        "locations": [
          {
            "end_line": 232,
            "path": "services/proxy/src/sweep.rs",
            "start_line": 232
          }
        ],
        "severity": "bug",
        "title": "bug"
      },
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "forget(&index, &gone)` runs unconditionally, including on a dry run \u2014 nothing in `sweep` removes blobs during a dry run, yet `gone` holds every candidate that *would* be removed, so `?dry_run=true`\u2026\n\nforget(&index, &gone)` runs unconditionally, including on a dry run \u2014 nothing in `sweep` removes blobs during a dry run, yet `gone` holds every candidate that *would* be removed, so `?dry_run=true` (documented as reporting \"without removing anything\") actually deletes the index entries naming those blobs, turning a read-only query into a destructive one.",
        "id": "f3",
        "locations": [
          {
            "end_line": 140,
            "path": "services/proxy/src/sweep.rs",
            "start_line": 140
          }
        ],
        "severity": "bug",
        "title": "bug"
      },
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "the on-demand route calls `app.sweeper.sweep(dry_run)` directly, which does not take the `running` mutex (sweep.rs:83) that exists precisely so two sweeps cannot each compute from a total the other\u2026\n\nthe on-demand route calls `app.sweeper.sweep(dry_run)` directly, which does not take the `running` mutex (sweep.rs:83) that exists precisely so two sweeps cannot each compute from a total the other is changing \u2014 a `POST /v1/admin/cache/sweep` racing the interval sweep (or a second POST) makes both evict against the same `held`, driving the store far below the ceiling and double-counting `removed`/`bytes` in the metrics.",
        "id": "f4",
        "locations": [
          {
            "end_line": 76,
            "path": "services/proxy/src/routes/admin.rs",
            "start_line": 76
          }
        ],
        "severity": "bug",
        "title": "bug"
      },
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "when `fs::remove_file` fails (line 126), the blob is still pushed to `gone` and counted in `removed`/`bytes`, so `forget` deletes index entries pointing at a blob that still exists (next resolve\u2026\n\nwhen `fs::remove_file` fails (line 126), the blob is still pushed to `gone` and counted in `removed`/`bytes`, so `forget` deletes index entries pointing at a blob that still exists (next resolve misses and refetches) and the sweep metrics overstate what was reclaimed.",
        "id": "f5",
        "locations": [
          {
            "end_line": 137,
            "path": "services/proxy/src/sweep.rs",
            "start_line": 137
          }
        ],
        "severity": "bug",
        "title": "bug"
      },
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "the doc comment claims \"the first tick is one interval away\", but `tokio::time::interval`'s first tick completes immediately, so a sweep runs at startup \u2014 harmless on an empty store, but on a\u2026\n\nthe doc comment claims \"the first tick is one interval away\", but `tokio::time::interval`'s first tick completes immediately, so a sweep runs at startup \u2014 harmless on an empty store, but on a restart with a populated store and clients already hitting it, it makes the in-flight-partial deletion and the commit\u2192link eviction window in `sweep.rs` fire on the very first requests rather than one interval in.",
        "id": "f6",
        "locations": [
          {
            "end_line": 108,
            "path": "services/proxy/src/main.rs",
            "start_line": 108
          }
        ],
        "severity": "bug",
        "title": "bug"
      },
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "sweep()` is fully synchronous (the module doc at sweep.rs:14-18 commits to stdlib `fs`), and the handler runs it inline on a tokio worker thread \u2014 a walk over tens of thousands of directories plus a\u2026\n\nsweep()` is fully synchronous (the module doc at sweep.rs:14-18 commits to stdlib `fs`), and the handler runs it inline on a tokio worker thread \u2014 a walk over tens of thousands of directories plus a read of every index entry can block a worker for minutes, starving the very cache serves the untimed route exists to protect; it needs `spawn_blocking`.",
        "id": "f7",
        "locations": [
          {
            "end_line": 76,
            "path": "services/proxy/src/routes/admin.rs",
            "start_line": 76
          }
        ],
        "severity": "bug",
        "title": "bug"
      },
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "collect` recurses through symlinked directories (`fs::metadata` follows symlinks, `is_dir()` is true for a dir symlink) with no cycle check, despite the comment at lines 160-163 explicitly\u2026\n\ncollect` recurses through symlinked directories (`fs::metadata` follows symlinks, `is_dir()` is true for a dir symlink) with no cycle check, despite the comment at lines 160-163 explicitly contemplating a store populated by links \u2014 a symlink loop under `blobs/` recurses until the stack overflows, taking down the process.",
        "id": "f8",
        "locations": [
          {
            "end_line": 168,
            "path": "services/proxy/src/sweep.rs",
            "start_line": 168
          }
        ],
        "severity": "bug",
        "title": "bug"
      }
    ],
    "problems": [],
    "state": "measured"
  },
  "harness": {
    "adapter": {
      "digest": "sha256:a1a935298956020ee6d767a756847abb4c00694c88c2eb80d454886ebc4acf8c",
      "id": "afi",
      "version": "1"
    },
    "commit": "a7aa25027b6edfbb2a50b13e24d995fdd4f95ca8",
    "digest": "sha256:a1a935298956020ee6d767a756847abb4c00694c88c2eb80d454886ebc4acf8c",
    "dirty": false,
    "id": "bench",
    "repository_url": "https://github.com/smykla-skalski/benchee",
    "version": "1"
  },
  "incremental": {
    "carried_count": null,
    "mode": "not_recorded",
    "prior_reviewed_sha": null,
    "reused_tokens": null,
    "state_source": null
  },
  "label": "glm-5.3-flash",
  "metrics": {
    "anchor_max": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 0
    },
    "anchor_median": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 0
    },
    "anchor_missed": {
      "reason": "no judging pass has looked beyond the scored slack",
      "state": "not_recorded",
      "unit": "count",
      "value": null
    },
    "carried": {
      "reason": "the reviewer reported no reuse figure",
      "state": "not_recorded",
      "unit": "count",
      "value": null
    },
    "category_defect": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.46153846153846156
    },
    "category_maintainability": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.0
    },
    "category_performance": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.3333333333333333
    },
    "category_security": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.5
    },
    "f1": {
      "reason": "no qualified judge decided these findings, so only locality was measured",
      "state": "not_applicable",
      "unit": "ratio",
      "value": null
    },
    "finding_count": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 8
    },
    "found": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 8
    },
    "intended": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 0
    },
    "judge_bill": {
      "reason": "no qualified judge decided these findings, so only locality was measured",
      "state": "not_applicable",
      "unit": "usd",
      "value": null
    },
    "missed": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 12
    },
    "precision": {
      "reason": "no qualified judge decided these findings, so only locality was measured",
      "state": "not_applicable",
      "unit": "ratio",
      "value": null
    },
    "recall": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.4
    },
    "review_bill": {
      "reason": null,
      "state": "measured",
      "unit": "usd",
      "value": 0.01392502
    },
    "seconds": {
      "reason": null,
      "state": "measured",
      "unit": "seconds",
      "value": 104.0
    },
    "tier_1": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.3333333333333333
    },
    "tier_2": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.42857142857142855
    },
    "tier_3": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.5
    },
    "tier_4": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.25
    },
    "tokens": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 41967
    },
    "total_bill": {
      "reason": null,
      "state": "measured",
      "unit": "usd",
      "value": 0.01392502
    },
    "unkeyed": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 0
    }
  },
  "producer": {
    "commit": "a7aa25027b6edfbb2a50b13e24d995fdd4f95ca8",
    "digest": "sha256:a1a935298956020ee6d767a756847abb4c00694c88c2eb80d454886ebc4acf8c",
    "dirty": false,
    "id": "benchee",
    "repository_url": "https://github.com/smykla-skalski/benchee",
    "version": "1"
  },
  "reviewer": {
    "id": "afi",
    "label": "afi review",
    "repository_url": "https://github.com/smykla-skalski/afi",
    "tool": {
      "interface": "cli",
      "name": "afi"
    }
  },
  "run_id": "afi/glm-5.3-flash/20260831T173720Z",
  "runtime": {
    "architecture": "arm64",
    "cache_mode": null,
    "cpus": 14,
    "memory_bytes": 38654705664,
    "os": "Darwin",
    "provider_route": "openrouter",
    "region": null,
    "runner_image": null
  },
  "schema": "benchee-run-1",
  "stamp": "20260831T173720Z",
  "status": {
    "reason": null,
    "state": "completed"
  },
  "target": {
    "base_sha": null,
    "diff_digest": "sha256:8b6acd80424c8af9017d7db2e1ceeaca4da5cf1f29e87c3559b2e5ea55782cfe",
    "pull_request": 8,
    "repository_url": "https://github.com/smykla-skalski/cairn",
    "reviewed_sha": "9b51f95ef609a219e211e37b082cd2e6913190e0"
  },
  "usage": {
    "reason": null,
    "state": "measured",
    "value": {
      "cached_input_tokens": 48384,
      "input_tokens": 41480,
      "models": null,
      "output_tokens": 487,
      "reasoning_tokens": 12405,
      "requests": 4,
      "stages": []
    }
  }
}
