{
  "assessment": {
    "decisions": [
      {
        "decided_by": "locality",
        "defect_id": "17",
        "finding_id": "f1",
        "id": "d1",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "11",
        "finding_id": "f2",
        "id": "d2",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "6",
        "finding_id": "f3",
        "id": "d3",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "13",
        "finding_id": "f4",
        "id": "d4",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "1",
        "finding_id": "f5",
        "id": "d5",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "4",
        "finding_id": "f6",
        "id": "d6",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "2",
        "finding_id": "f7",
        "id": "d7",
        "outcome": "matched",
        "reason": null
      }
    ],
    "judge": null,
    "judged": false,
    "scorer": {
      "commit": "348a7e367b8c52f1ce72828ed09c15b0e9fac38b",
      "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": "bcdf242be4e8",
    "label": "default",
    "models": [
      {
        "effort": "high",
        "model": "moonshotai/kimi-k3",
        "protocol": null,
        "provider": "moonshotai",
        "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:890114ae802284d51d188df1d2d36184c1489f13ff939456db63ad4b2e9e4f59",
      "media_type": "application/json",
      "path": "summary.json",
      "role": "summary"
    },
    {
      "digest": "sha256:ca93fae9328846357b885527fe9d7d44ffe73f1cdf46d314cc378b62983b8a99",
      "media_type": "application/json",
      "path": "findings.json",
      "role": "findings"
    },
    {
      "digest": "sha256:e41de1856af6384ff3962416d5b7592d339053c8536137dceebde0f8e054e082",
      "media_type": "application/json",
      "path": "meta.json",
      "role": "meta"
    },
    {
      "digest": "sha256:f3fd80105ca688bcd03138b4a781750d068c2e800b7fcc3d01e71afbe13cf1c0",
      "media_type": "application/json",
      "path": "spend.json",
      "role": "spend"
    },
    {
      "digest": "sha256:2656bdbbbfc857287f8fc4c77be2d72f485823795691115d1be8275fed8b42c9",
      "media_type": "application/jsonl",
      "path": "result.jsonl",
      "role": "result"
    },
    {
      "digest": "sha256:1c7060d5c65f226942105ad039e9288331cba473bce03453ea035b07f1eac93f",
      "media_type": "text/plain",
      "path": "stderr.txt",
      "role": "stderr"
    },
    {
      "digest": "sha256:cb94d7df7103c85684d7496e655fdb6492297b3e6e1dcbcf2d0b33273d7196c8",
      "media_type": "application/gzip",
      "path": "afi-home/logs.tar.gz",
      "role": "traffic"
    }
  ],
  "execution": {
    "billing_limit_usd": 12.0,
    "budget_usd": 12.0,
    "deadline_exceeded": false,
    "exit_code": 0,
    "finished_at": "2026-08-31T16:19:10Z",
    "started_at": "2026-08-31T16:17:12Z",
    "wall_seconds": 118.0
  },
  "extensions": {
    "afi": {
      "found_per_pass": {
        "agent": 7
      },
      "passes": null,
      "review_seconds": 115.965,
      "tier1_only": false,
      "variant_hash": null
    }
  },
  "findings": {
    "items": [
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "clear_partials` unconditionally unlinks every file in `incoming/`, but `BlobStore::writer` (store.rs:171) and `link` (store.rs:147) keep *in-progress* fetches and index temp writes in that same\u2026\n\nclear_partials` unconditionally unlinks every file in `incoming/`, but `BlobStore::writer` (store.rs:171) and `link` (store.rs:147) keep *in-progress* fetches and index temp writes in that same directory \u2014 the doc claim \"a file in `incoming` is a fetch that is not coming back\" is false, so any sweep concurrent with a download (every 15 min via `spawn_sweeps`) deletes the partial out from under the writer and the fetch fails at `commit`'s rename",
        "id": "f1",
        "locations": [
          {
            "end_line": 224,
            "path": "services/proxy/src/sweep.rs",
            "start_line": 224
          }
        ],
        "severity": "bug",
        "title": "bug"
      },
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "reclaim` calls `app.sweeper.sweep(dry_run)` directly, bypassing the `running` mutex that only `Sweeper::run` acquires (sweep.rs:83) \u2014 the module's own one-at-a-time invariant (sweep.rs:10) is\u2026\n\nreclaim` calls `app.sweeper.sweep(dry_run)` directly, bypassing the `running` mutex that only `Sweeper::run` acquires (sweep.rs:83) \u2014 the module's own one-at-a-time invariant (sweep.rs:10) is broken, so a concurrent manual sweep and interval sweep each compute removals from a total the other is changing and jointly delete the store far below the ceiling",
        "id": "f2",
        "locations": [
          {
            "end_line": 76,
            "path": "services/proxy/src/routes/admin.rs",
            "start_line": 76
          }
        ],
        "severity": "bug",
        "title": "bug"
      },
      {
        "attributes": {
          "category": "performance",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "sweep(dry_run)` is fully synchronous (`fs::read_dir`/`fs::metadata`/`fs::read`/`fs::remove_file` over the entire store) yet runs directly in the async handler and in the spawned loop in main.rs:116\u2026\n\nsweep(dry_run)` is fully synchronous (`fs::read_dir`/`fs::metadata`/`fs::read`/`fs::remove_file` over the entire store) yet runs directly in the async handler and in the spawned loop in main.rs:116 \u2014 it blocks a Tokio worker thread for the whole duration of a multi-second walk of a large store, stalling unrelated requests the worker was driving",
        "id": "f3",
        "locations": [
          {
            "end_line": 76,
            "path": "services/proxy/src/routes/admin.rs",
            "start_line": 76
          }
        ],
        "severity": "performance",
        "title": "performance"
      },
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "values()` returns `sweep_bytes_reclaimed` then `sweep_blobs_removed`, but `COUNTERS` declares `cairn_proxy_sweep_blobs_removed_total` (line 51) before `cairn_proxy_sweep_bytes_reclaimed_total` (line\u2026\n\nvalues()` returns `sweep_bytes_reclaimed` then `sweep_blobs_removed`, but `COUNTERS` declares `cairn_proxy_sweep_blobs_removed_total` (line 51) before `cairn_proxy_sweep_bytes_reclaimed_total` (line 55) \u2014 the positional zip in `render` (line 107) swaps the two, so every scrape exports the blob count under the bytes name and the byte count under the blobs name, silently breaking the `cairn_proxy_sweep_bytes_reclaimed_total` alerting docs/operations.md now prescribes",
        "id": "f4",
        "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": "eviction candidates are sorted by *ascending* `age` (\"oldest first\" per the comment, but ascending age is newest-first), and combined with the loop at line 119 removing while `remaining >=\u2026\n\neviction candidates are sorted by *ascending* `age` (\"oldest first\" per the comment, but ascending age is newest-first), and combined with the loop at line 119 removing while `remaining >= max_bytes`, the sweep deletes the most recently fetched blobs first and stops before touching the actually-oldest ones \u2014 the exact opposite of the stated LRU intent",
        "id": "f5",
        "locations": [
          {
            "end_line": 102,
            "path": "services/proxy/src/sweep.rs",
            "start_line": 102
          }
        ],
        "severity": "bug",
        "title": "bug"
      },
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "the comment says a symlink \"is counted at the size of the link\", but line 164 uses `fs::metadata`, which follows links \u2014 a symlinked blob is counted at its target's size while line 126's\u2026\n\nthe comment says a symlink \"is counted at the size of the link\", but line 164 uses `fs::metadata`, which follows links \u2014 a symlinked blob is counted at its target's size while line 126's `fs::remove_file` removes only the link, reclaiming no bytes, so `remaining`/`bytes` are inflated and the sweep reports and stops on numbers that do not match what was freed",
        "id": "f6",
        "locations": [
          {
            "end_line": 160,
            "path": "services/proxy/src/sweep.rs",
            "start_line": 160
          }
        ],
        "severity": "bug",
        "title": "bug"
      },
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "remaining` is decremented and `bytes`/`removed` incremented even when the `fs::remove_file` at line 126 failed (the error is only logged at debug), so a blob that could not be deleted is treated as\u2026\n\nremaining` is decremented and `bytes`/`removed` incremented even when the `fs::remove_file` at line 126 failed (the error is only logged at debug), so a blob that could not be deleted is treated as reclaimed \u2014 the reported totals and the stop condition diverge from what is actually on disk",
        "id": "f7",
        "locations": [
          {
            "end_line": 134,
            "path": "services/proxy/src/sweep.rs",
            "start_line": 134
          }
        ],
        "severity": "bug",
        "title": "bug"
      }
    ],
    "problems": [],
    "state": "measured"
  },
  "harness": {
    "adapter": {
      "digest": "sha256:a1a935298956020ee6d767a756847abb4c00694c88c2eb80d454886ebc4acf8c",
      "id": "afi",
      "version": "1"
    },
    "commit": "348a7e367b8c52f1ce72828ed09c15b0e9fac38b",
    "digest": "sha256:a1a935298956020ee6d767a756847abb4c00694c88c2eb80d454886ebc4acf8c",
    "dirty": true,
    "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": "kimi-k3",
  "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.38461538461538464
    },
    "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": 7
    },
    "found": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 7
    },
    "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": 13
    },
    "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.35
    },
    "review_bill": {
      "reason": null,
      "state": "measured",
      "unit": "usd",
      "value": 0.2731575
    },
    "seconds": {
      "reason": null,
      "state": "measured",
      "unit": "seconds",
      "value": 118.0
    },
    "tier_1": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.6666666666666666
    },
    "tier_2": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.2857142857142857
    },
    "tier_3": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.3333333333333333
    },
    "tier_4": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.25
    },
    "tokens": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 35839
    },
    "total_bill": {
      "reason": null,
      "state": "measured",
      "unit": "usd",
      "value": 0.2731575
    },
    "unkeyed": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 0
    }
  },
  "producer": {
    "commit": "348a7e367b8c52f1ce72828ed09c15b0e9fac38b",
    "digest": "sha256:a1a935298956020ee6d767a756847abb4c00694c88c2eb80d454886ebc4acf8c",
    "dirty": true,
    "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/kimi-k3/20260831T161341Z",
  "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": "20260831T161341Z",
  "status": {
    "reason": null,
    "state": "completed"
  },
  "target": {
    "base_sha": null,
    "diff_digest": "sha256:c921265207938d025d4f2fb47329c377b767144efa630b4072a3836de9cea371",
    "pull_request": 8,
    "repository_url": "https://github.com/smykla-skalski/cairn",
    "reviewed_sha": "9b51f95ef609a219e211e37b082cd2e6913190e0"
  },
  "usage": {
    "reason": null,
    "state": "measured",
    "value": {
      "cached_input_tokens": 69640,
      "input_tokens": 34466,
      "models": null,
      "output_tokens": 1373,
      "reasoning_tokens": 6896,
      "requests": 4,
      "stages": []
    }
  }
}
