{
  "assessment": {
    "decisions": [
      {
        "decided_by": "locality",
        "defect_id": "11",
        "finding_id": "f1",
        "id": "d1",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "9",
        "finding_id": "f2",
        "id": "d2",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "13",
        "finding_id": "f3",
        "id": "d3",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "6",
        "finding_id": "f4",
        "id": "d4",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "12",
        "finding_id": "f5",
        "id": "d5",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "2",
        "finding_id": "f6",
        "id": "d6",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "scorer",
        "defect_id": null,
        "finding_id": "f7",
        "id": "d7",
        "outcome": "rejected",
        "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:4c712af8bee5257277c3dca94214a940d8ec001ee0f20afb1185326a474f627d",
      "media_type": "application/json",
      "path": "summary.json",
      "role": "summary"
    },
    {
      "digest": "sha256:17e3b79ee73346f36ff7c77024ce4509084d69c62bd4e4093a97c072d7dce1fa",
      "media_type": "application/json",
      "path": "findings.json",
      "role": "findings"
    },
    {
      "digest": "sha256:eba6cc4370aeb02bea9687fb3f1e7d960039b13f493d3e544369ebfb8538d857",
      "media_type": "application/json",
      "path": "meta.json",
      "role": "meta"
    },
    {
      "digest": "sha256:47da4f56d7dac157f842a58993126e1e4ddd8ed4f9b5eac9586c27c4471ad703",
      "media_type": "application/json",
      "path": "spend.json",
      "role": "spend"
    },
    {
      "digest": "sha256:14f84128e59525049fb09c1ac50bad788fdc077caf086a057186ae1bb76ac9e2",
      "media_type": "application/jsonl",
      "path": "result.jsonl",
      "role": "result"
    },
    {
      "digest": "sha256:ce5201e1b81f3d8c584d0fe55d4122ccc2dc08fa7a1a3f6e2fba266422f126aa",
      "media_type": "text/plain",
      "path": "stderr.txt",
      "role": "stderr"
    },
    {
      "digest": "sha256:3fcfcc2f7e3dcedc8b0666ba99342fab69c394e1097372c8a7274e5299f64d42",
      "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:22:18Z",
    "started_at": "2026-08-31T16:19:54Z",
    "wall_seconds": 144.0
  },
  "extensions": {
    "afi": {
      "found_per_pass": {
        "agent": 7
      },
      "passes": null,
      "review_seconds": 140.496,
      "tier1_only": false,
      "variant_hash": null
    }
  },
  "findings": {
    "items": [
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "The on-demand sweep route calls `app.sweeper.sweep(dry_run)` directly and never acquires the `running` mutex \u2014 only `Sweeper::run()` (sweep.rs:83) locks it \u2014 so a manual `POST /v1/admin/cache/sweep`\u2026\n\nThe on-demand sweep route calls `app.sweeper.sweep(dry_run)` directly and never acquires the `running` mutex \u2014 only `Sweeper::run()` (sweep.rs:83) locks it \u2014 so a manual `POST /v1/admin/cache/sweep` runs concurrently with the interval sweep, and both decide removals from a shared `remaining` total, deleting up to twice the bytes needed and taking the store far below the ceiling (the exact failure sweep.rs:10-12's \"one sweep at a time\" comment says the mutex exists to prevent).",
        "id": "f1",
        "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": "clear_partials` unconditionally unlinks every file in `incoming`, including partial writes of fetches actively streaming right now (`BlobWriter` holds its temp file open there until commit, per\u2026\n\nclear_partials` unconditionally unlinks every file in `incoming`, including partial writes of fetches actively streaming right now (`BlobWriter` holds its temp file open there until commit, per store.rs:171-180) \u2014 a sweep during a long download deletes the in-progress file, which then commits to a dangling path or fails, so a client request gets a 500 because the timer fired mid-fetch; the doc comment's claim that \"a file in `incoming` is a fetch that is not coming back\" is false for any fetch in flight.",
        "id": "f2",
        "locations": [
          {
            "end_line": 91,
            "path": "services/proxy/src/sweep.rs",
            "start_line": 91
          }
        ],
        "severity": "bug",
        "title": "bug"
      },
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "values()` loads `sweep_bytes_reclaimed` fifth and `sweep_blobs_removed` sixth, but `COUNTERS` lists `cairn_proxy_sweep_blobs_removed_total` fifth and `cairn_proxy_sweep_bytes_reclaimed_total` sixth\u2026\n\nvalues()` loads `sweep_bytes_reclaimed` fifth and `sweep_blobs_removed` sixth, but `COUNTERS` lists `cairn_proxy_sweep_blobs_removed_total` fifth and `cairn_proxy_sweep_bytes_reclaimed_total` sixth \u2014 so the two sweep metrics are permanently rendered under each other's names, silently swapping every reported value (the exact failure the comment above says the pairing exists to prevent).",
        "id": "f3",
        "locations": [
          {
            "end_line": 94,
            "path": "services/proxy/src/metrics.rs",
            "start_line": 94
          }
        ],
        "severity": "bug",
        "title": "bug"
      },
      {
        "attributes": {
          "category": "performance",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "sweep()` is synchronous \u2014 it walks the whole store with blocking `fs` calls, and `referenced()` additionally reads and JSON-parses every index entry file \u2014 so calling it from the axum handler blocks\u2026\n\nsweep()` is synchronous \u2014 it walks the whole store with blocking `fs` calls, and `referenced()` additionally reads and JSON-parses every index entry file \u2014 so calling it from the axum handler blocks the worker thread for the duration of a full scan of a large store, stalling all other requests (the same blocking walk also runs on the timer at main.rs:116); the \"synchronous walk costs less\" rationale in sweep.rs only holds if it were dispatched to `spawn_blocking`.",
        "id": "f4",
        "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": "forget(&index, &gone)` runs even on a dry run (sweep.rs:90's `dry_run` gate only covers blob and partial removal), so `POST /v1/admin/cache/sweep?dry_run=true` permanently deletes index entries \u2014\u2026\n\nforget(&index, &gone)` runs even on a dry run (sweep.rs:90's `dry_run` gate only covers blob and partial removal), so `POST /v1/admin/cache/sweep?dry_run=true` permanently deletes index entries \u2014 directly contradicting the documented \"reports what a sweep would reclaim without removing anything\" and forcing refetches/re-registration for those coordinates.",
        "id": "f5",
        "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": "after a failed `fs::remove_file` (logged at :130) the code still does `bytes += candidate.size; removed += 1` unconditionally, so `Reclaimed` and the\u2026\n\nafter a failed `fs::remove_file` (logged at :130) the code still does `bytes += candidate.size; removed += 1` unconditionally, so `Reclaimed` and the `cairn_proxy_sweep_bytes_reclaimed_total`/`blobs_removed_total` counters report space as reclaimed that is still on disk \u2014 the metric operations docs tell operators to alert on.",
        "id": "f6",
        "locations": [
          {
            "end_line": 135,
            "path": "services/proxy/src/sweep.rs",
            "start_line": 135
          }
        ],
        "severity": "bug",
        "title": "bug"
      },
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "Duration::from_hours(1)` and `Duration::from_mins(15)` (also used at :84 and in tests at :350-351) are nightly-only std APIs, while services/proxy/rust-toolchain.toml pins `channel = \"stable\"` \u2014 the\u2026\n\nDuration::from_hours(1)` and `Duration::from_mins(15)` (also used at :84 and in tests at :350-351) are nightly-only std APIs, while services/proxy/rust-toolchain.toml pins `channel = \"stable\"` \u2014 the crate will not compile on the pinned toolchain once that gate hits stable Rust.",
        "id": "f7",
        "locations": [
          {
            "end_line": 83,
            "path": "services/proxy/src/config.rs",
            "start_line": 83
          }
        ],
        "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": 3
    },
    "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.3076923076923077
    },
    "category_maintainability": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.0
    },
    "category_performance": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.6666666666666666
    },
    "category_security": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.0
    },
    "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": 6
    },
    "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": 14
    },
    "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.3
    },
    "review_bill": {
      "reason": null,
      "state": "measured",
      "unit": "usd",
      "value": 0.33856119
    },
    "seconds": {
      "reason": null,
      "state": "measured",
      "unit": "seconds",
      "value": 144.0
    },
    "tier_1": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.3333333333333333
    },
    "tier_2": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.2857142857142857
    },
    "tier_3": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.5
    },
    "tier_4": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.0
    },
    "tokens": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 37666
    },
    "total_bill": {
      "reason": null,
      "state": "measured",
      "unit": "usd",
      "value": 0.33856119
    },
    "unkeyed": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 1
    }
  },
  "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/20260831T161342Z",
  "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": "20260831T161342Z",
  "status": {
    "reason": null,
    "state": "completed"
  },
  "target": {
    "base_sha": null,
    "diff_digest": "sha256:e4038205478b5c2646697e6c6a82c1ab83e90117fe066c4f7862592287880c01",
    "pull_request": 8,
    "repository_url": "https://github.com/smykla-skalski/cairn",
    "reviewed_sha": "9b51f95ef609a219e211e37b082cd2e6913190e0"
  },
  "usage": {
    "reason": null,
    "state": "measured",
    "value": {
      "cached_input_tokens": 169983,
      "input_tokens": 35851,
      "models": null,
      "output_tokens": 1815,
      "reasoning_tokens": 8134,
      "requests": 7,
      "stages": []
    }
  }
}
