{
  "assessment": {
    "decisions": [
      {
        "decided_by": "locality",
        "defect_id": "12",
        "finding_id": "f1",
        "id": "d1",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "13",
        "finding_id": "f2",
        "id": "d2",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "1",
        "finding_id": "f3",
        "id": "d3",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "17",
        "finding_id": "f4",
        "id": "d4",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "18",
        "finding_id": "f5",
        "id": "d5",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "11",
        "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
      },
      {
        "decided_by": "locality",
        "defect_id": "3",
        "finding_id": "f9",
        "id": "d9",
        "outcome": "matched",
        "reason": null
      }
    ],
    "judge": null,
    "judged": false,
    "scorer": {
      "commit": "3c151df56e62cfdea90b84dd8b265f7e0f4bebff",
      "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": "a5df80571ddb",
    "label": "default",
    "models": [
      {
        "effort": "high",
        "model": "anthropic/claude-opus-5",
        "protocol": null,
        "provider": "anthropic",
        "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:be8679c4bcad9698879dae2d1b217657f9b9f11771e1ca1de3cee7c637e6f07e",
      "media_type": "application/json",
      "path": "summary.json",
      "role": "summary"
    },
    {
      "digest": "sha256:349de0c2a1a5ac37981736a2e4e2f48392cecbfb2202ead9ae655424f4a3d4e5",
      "media_type": "application/json",
      "path": "findings.json",
      "role": "findings"
    },
    {
      "digest": "sha256:4ef811e1c2f4e65ecfefb37d927884fe90ca326a7ff6e9c8ca0061573163a609",
      "media_type": "application/json",
      "path": "meta.json",
      "role": "meta"
    },
    {
      "digest": "sha256:1b7225b42aa88928cb280e5d28dd521922669afe629b68299959a12a612b7f91",
      "media_type": "application/json",
      "path": "spend.json",
      "role": "spend"
    },
    {
      "digest": "sha256:17afba5ff4f15384ee3531cfdc9a0afc1f5470e6c773f0e4031fb4ebb14d4bda",
      "media_type": "application/jsonl",
      "path": "result.jsonl",
      "role": "result"
    },
    {
      "digest": "sha256:278950222f6f8e9aa37e5015b40416936a7a1714fdf029f9f25a829ffe21bb03",
      "media_type": "text/plain",
      "path": "stderr.txt",
      "role": "stderr"
    },
    {
      "digest": "sha256:13a0758c67f012dc6f8d2cd3773389e3b9535cd15673904ea4b46c4e1db7dc01",
      "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-31T15:33:27Z",
    "started_at": "2026-08-31T15:31:19Z",
    "wall_seconds": 129.0
  },
  "extensions": {
    "afi": {
      "found_per_pass": {
        "agent": 9
      },
      "passes": null,
      "review_seconds": 126.64,
      "tier1_only": false,
      "variant_hash": null
    }
  },
  "findings": {
    "items": [
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "forget` runs unconditionally, so `POST /v1/admin/cache/sweep?dry_run=true` deletes every index entry naming a blob it merely *reported* \u2014 `gone` is populated at line 137 regardless of `dry_run`.\n\nThe advertised \"reports what one would reclaim without removing anything\" (docs/operations.md) silently un-caches the store, and the next real sweep then deletes those now-unreferenced blobs.",
        "id": "f1",
        "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": "values()` returns bytes-reclaimed where `COUNTERS[4]` is `cairn_proxy_sweep_blobs_removed_total` and blobs-removed where `COUNTERS[5]` is `cairn_proxy_sweep_bytes_reclaimed_total`; the two sweep\u2026\n\nvalues()` returns bytes-reclaimed where `COUNTERS[4]` is `cairn_proxy_sweep_blobs_removed_total` and blobs-removed where `COUNTERS[5]` is `cairn_proxy_sweep_bytes_reclaimed_total`; the two sweep counters are exposed under each other's names, so the alert docs/operations.md tells operators to build on `cairn_proxy_sweep_bytes_reclaimed_total` reads a blob count. Swap lines 94 and 95.",
        "id": "f2",
        "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": "sort_by_key(|c| c.age)` orders *ascending* age \u2014 newest first \u2014 so the over-ceiling loop evicts the blobs most recently fetched, exactly the opposite of the comment on line 100 and of the\u2026\n\nsort_by_key(|c| c.age)` orders *ascending* age \u2014 newest first \u2014 so the over-ceiling loop evicts the blobs most recently fetched, exactly the opposite of the comment on line 100 and of the `CACHE_MIN_AGE` grace period's purpose (a fresh blob just past `min_age` goes before a year-old one). Sort by `std::cmp::Reverse(candidate.age)`.",
        "id": "f3",
        "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": "clear_partials` unlinks every file in `incoming` with no age or liveness test, but that directory holds the *in-flight* temp files of `BlobStore::writer` (store.rs:201) and of `BlobStore::link`\u2026\n\nclear_partials` unlinks every file in `incoming` with no age or liveness test, but that directory holds the *in-flight* temp files of `BlobStore::writer` (store.rs:201) and of `BlobStore::link` (store.rs:147). A sweep firing during a 200 MiB download deletes the file under the open handle, and `BlobWriter::commit`'s rename (store.rs:259) fails with ENOENT, turning a healthy fetch into a 500. Only files older than `min_age` (or than `fetch_timeout`) are abandoned.",
        "id": "f4",
        "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 \"nothing points at it\" branch ignores age, but a freshly committed blob is unreferenced for the whole of the registry round trip \u2014 cache.rs commits at line 151 and only calls `store.link` at\u2026\n\nthe \"nothing points at it\" branch ignores age, but a freshly committed blob is unreferenced for the whole of the registry round trip \u2014 cache.rs commits at line 151 and only calls `store.link` at line 163. A sweep in that window removes the blob, and the reopen at cache.rs:90 fails with \"a blob committed by this request is already missing from the store\". Unreferenced blobs must also be older than `min_age` before they are removed.",
        "id": "f5",
        "locations": [
          {
            "end_line": 119,
            "path": "services/proxy/src/sweep.rs",
            "start_line": 119
          }
        ],
        "severity": "bug",
        "title": "bug"
      },
      {
        "attributes": {
          "category": "performance",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "sweep` is a synchronous full-tree `read_dir`/`metadata`/`unlink` walk, and both callers run it directly on a runtime worker \u2014 `Sweeper::run` at line 84 and the handler at routes/admin.rs:76.\n\nOn the large store the module doc contemplates this parks a worker thread for the whole walk, stalling the async tasks (including in-flight artifact streams) scheduled on it. It needs `tokio::task::spawn_blocking`.",
        "id": "f6",
        "locations": [
          {
            "end_line": 90,
            "path": "services/proxy/src/sweep.rs",
            "start_line": 90
          }
        ],
        "severity": "performance",
        "title": "performance"
      },
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "the route calls `sweeper.sweep(...)` and not `sweeper.run()`, bypassing the `running` mutex (sweep.rs:67) that the module doc at sweep.rs:10 says makes one-sweep-at-a-time a property of the type.\n\nTwo concurrent `POST /v1/admin/cache/sweep` calls, or one racing the background tick, each size their removals against a total the other is shrinking and take the store far under the ceiling.",
        "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": "fs::metadata` follows symlinks, contradicting the comment on lines 160-163 \u2014 a symlink is counted at its *target's* size, and a symlinked directory inside the blob dir makes `collect` recurse\u2026\n\nfs::metadata` follows symlinks, contradicting the comment on lines 160-163 \u2014 a symlink is counted at its *target's* size, and a symlinked directory inside the blob dir makes `collect` recurse outside the store, where its files are then unreferenced and unlinked at line 126. Use `fs::symlink_metadata` and skip non-regular files.",
        "id": "f8",
        "locations": [
          {
            "end_line": 164,
            "path": "services/proxy/src/sweep.rs",
            "start_line": 164
          }
        ],
        "severity": "bug",
        "title": "bug"
      },
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "remaining >= self.max_bytes` removes one more blob when the store is exactly at the ceiling; the ceiling is documented as the most the store *may* hold, so this should be `>`.",
        "id": "f9",
        "locations": [
          {
            "end_line": 120,
            "path": "services/proxy/src/sweep.rs",
            "start_line": 120
          }
        ],
        "severity": "bug",
        "title": "bug"
      }
    ],
    "problems": [],
    "state": "measured"
  },
  "harness": {
    "adapter": {
      "digest": "sha256:a1a935298956020ee6d767a756847abb4c00694c88c2eb80d454886ebc4acf8c",
      "id": "afi",
      "version": "1"
    },
    "commit": "3c151df56e62cfdea90b84dd8b265f7e0f4bebff",
    "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": "opus-5",
  "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.5384615384615384
    },
    "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": 9
    },
    "found": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 9
    },
    "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": 11
    },
    "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.45
    },
    "review_bill": {
      "reason": null,
      "state": "measured",
      "unit": "usd",
      "value": 0.75455
    },
    "seconds": {
      "reason": null,
      "state": "measured",
      "unit": "seconds",
      "value": 129.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.5
    },
    "tier_4": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.5
    },
    "tokens": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 105889
    },
    "total_bill": {
      "reason": null,
      "state": "measured",
      "unit": "usd",
      "value": 0.75455
    },
    "unkeyed": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 0
    }
  },
  "producer": {
    "commit": "3c151df56e62cfdea90b84dd8b265f7e0f4bebff",
    "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/opus-5/20260831T152642Z",
  "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": "20260831T152642Z",
  "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": 0,
      "input_tokens": 103695,
      "models": null,
      "output_tokens": 2194,
      "reasoning_tokens": 7249,
      "requests": 3,
      "stages": []
    }
  }
}
