{
  "assessment": {
    "decisions": [
      {
        "decided_by": "locality",
        "defect_id": "18",
        "finding_id": "f1",
        "id": "d1",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "12",
        "finding_id": "f2",
        "id": "d2",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "17",
        "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": "13",
        "finding_id": "f5",
        "id": "d5",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "6",
        "finding_id": "f6",
        "id": "d6",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "2",
        "finding_id": "f7",
        "id": "d7",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "8",
        "finding_id": "f8",
        "id": "d8",
        "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:74a89089a9ac92e58d043fe020f4004958447c9c8c45c29c085dd4ed02ee2931",
      "media_type": "application/json",
      "path": "summary.json",
      "role": "summary"
    },
    {
      "digest": "sha256:52380575af985ea91a242a325eb0b7b39e08d731830cde28c9ee6129940ae728",
      "media_type": "application/json",
      "path": "findings.json",
      "role": "findings"
    },
    {
      "digest": "sha256:df0f903a8b5ba7aa993c87550b44c62b113da4dffab81128ab8ceb39ff09c702",
      "media_type": "application/json",
      "path": "meta.json",
      "role": "meta"
    },
    {
      "digest": "sha256:ab436f40ef7f6de0b3c724b3b7d3e6e9077c3f57108eebe7582b56e89f5889ff",
      "media_type": "application/json",
      "path": "spend.json",
      "role": "spend"
    },
    {
      "digest": "sha256:6eee28af434103515e8e84b12918fcf509cb664bf0b172132dff794fd98b8502",
      "media_type": "application/jsonl",
      "path": "result.jsonl",
      "role": "result"
    },
    {
      "digest": "sha256:ce6bf2f85f68ee711dd77fbd61cddb4073255135a936d721ff5d4ffb4fc6d37d",
      "media_type": "text/plain",
      "path": "stderr.txt",
      "role": "stderr"
    },
    {
      "digest": "sha256:9b6345e70027729bf723d9d3e51b27acd171c37de54a4285393a4a43bc388d94",
      "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:16:31Z",
    "started_at": "2026-08-31T16:13:46Z",
    "wall_seconds": 165.0
  },
  "extensions": {
    "afi": {
      "found_per_pass": {
        "agent": 8
      },
      "passes": null,
      "review_seconds": 162.504,
      "tier1_only": false,
      "variant_hash": null
    }
  },
  "findings": {
    "items": [
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "a blob with no index entry is deleted regardless of `min_age`, but a fetch commits the blob (cache.rs:151) and only writes the index entry after a registry round-trip (cache.rs:163), so a sweep in\u2026\n\na blob with no index entry is deleted regardless of `min_age`, but a fetch commits the blob (cache.rs:151) and only writes the index entry after a registry round-trip (cache.rs:163), so a sweep in that seconds-long gap deletes the just-committed blob \u2014 the in-flight request then 500s at cache.rs:90-97 (\"already missing from the store\") despite the artifact existing.",
        "id": "f1",
        "locations": [
          {
            "end_line": 119,
            "path": "services/proxy/src/sweep.rs",
            "start_line": 119
          }
        ],
        "severity": "bug",
        "title": "bug"
      },
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "forget(&index, &gone)` runs unconditionally and `gone` is populated even when `dry_run` is true (line 137 sits outside the `if !dry_run` guard), so `POST /v1/admin/cache/sweep?dry_run=true` \u2014\u2026\n\nforget(&index, &gone)` runs unconditionally and `gone` is populated even when `dry_run` is true (line 137 sits outside the `if !dry_run` guard), so `POST /v1/admin/cache/sweep?dry_run=true` \u2014 documented as removing nothing \u2014 deletes live index entries for every blob it would have reclaimed, forcing refetches of all of them.",
        "id": "f2",
        "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": "clear_partials` deletes every file in `incoming/` with no age or name check, but in-flight downloads and index-link temp files live there (store.rs:171-180 and store.rs:147); a sweep overlapping any\u2026\n\nclear_partials` deletes every file in `incoming/` with no age or name check, but in-flight downloads and index-link temp files live there (store.rs:171-180 and store.rs:147); a sweep overlapping any active fetch unlinks its temp file from under the open handle, so `commit`'s rename fails with ENOENT and a download that succeeded upstream returns a 500.",
        "id": "f3",
        "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": "the on-demand sweep calls `sweeper.sweep()` directly, bypassing the `Mutex` that `run()` holds for the whole sweep (sweep.rs:83), so an HTTP-triggered sweep can run concurrently with the interval\u2026\n\nthe on-demand sweep calls `sweeper.sweep()` directly, bypassing the `Mutex` that `run()` holds for the whole sweep (sweep.rs:83), so an HTTP-triggered sweep can run concurrently with the interval sweep \u2014 the exact \"two sweeps over one directory\" over-deletion the module says the type prevents (sweep.rs:10-12) \u2014 and both will double-count the reclaimed 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": "values()` loads `sweep_bytes_reclaimed` then `sweep_blobs_removed`, but `COUNTERS` declares blobs first (lines 50-57), so the two counters are exported swapped \u2014\u2026\n\nvalues()` loads `sweep_bytes_reclaimed` then `sweep_blobs_removed`, but `COUNTERS` declares blobs first (lines 50-57), so the two counters are exported swapped \u2014 `cairn_proxy_sweep_blobs_removed_total` reports bytes and `cairn_proxy_sweep_bytes_reclaimed_total` reports blob counts, defeating the pairing comment at lines 30-32 and the alerting docs/operations.md prescribes on the bytes counter.",
        "id": "f5",
        "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": "sweeper.run()` executes the entire synchronous `std::fs` walk (readdir + stat + unlink over the whole store) directly on a runtime worker thread with no `spawn_blocking`, stalling request handling\u2026\n\nsweeper.run()` executes the entire synchronous `std::fs` walk (readdir + stat + unlink over the whole store) directly on a runtime worker thread with no `spawn_blocking`, stalling request handling on that worker for the duration of the sweep \u2014 the same applies to the admin handler at routes/admin.rs:76, which is additionally on the untimed router so it can block for minutes on a large store.",
        "id": "f6",
        "locations": [
          {
            "end_line": 116,
            "path": "services/proxy/src/main.rs",
            "start_line": 116
          }
        ],
        "severity": "performance",
        "title": "performance"
      },
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "after a failed `fs::remove_file` (line 126) the candidate is still counted in `removed`/`bytes` and pushed to `gone`, so the reported and recorded reclamation exceeds what was actually freed, and\u2026\n\nafter a failed `fs::remove_file` (line 126) the candidate is still counted in `removed`/`bytes` and pushed to `gone`, so the reported and recorded reclamation exceeds what was actually freed, and `forget` (line 140) deletes index entries for blobs that are still on disk.",
        "id": "f7",
        "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": "tokio::time::interval` completes its first tick immediately, contradicting the comment at lines 101-102 (\"the first tick is one interval away\") \u2014 a freshly started proxy sweeps at boot; use\u2026\n\ntokio::time::interval` completes its first tick immediately, contradicting the comment at lines 101-102 (\"the first tick is one interval away\") \u2014 a freshly started proxy sweeps at boot; use `interval_at` with a delayed start to get the documented behavior.",
        "id": "f8",
        "locations": [
          {
            "end_line": 115,
            "path": "services/proxy/src/main.rs",
            "start_line": 115
          }
        ],
        "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.46153846153846156
    },
    "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": 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.35500938
    },
    "seconds": {
      "reason": null,
      "state": "measured",
      "unit": "seconds",
      "value": 165.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.5
    },
    "tokens": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 41692
    },
    "total_bill": {
      "reason": null,
      "state": "measured",
      "unit": "usd",
      "value": 0.35500938
    },
    "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/20260831T161340Z",
  "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": "20260831T161340Z",
  "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": 101556,
      "input_tokens": 40088,
      "models": null,
      "output_tokens": 1604,
      "reasoning_tokens": 9863,
      "requests": 5,
      "stages": []
    }
  }
}
