{
  "assessment": {
    "decisions": [
      {
        "decided_by": "locality",
        "defect_id": "13",
        "finding_id": "f1",
        "id": "d1",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "6",
        "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": "17",
        "finding_id": "f4",
        "id": "d4",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "11",
        "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": "18",
        "finding_id": "f7",
        "id": "d7",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "2",
        "finding_id": "f8",
        "id": "d8",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "7",
        "finding_id": "f9",
        "id": "d9",
        "outcome": "matched",
        "reason": null
      }
    ],
    "judge": null,
    "judged": false,
    "scorer": {
      "commit": "d5372b5a9797137af68e35c478f308f58ca4510c",
      "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:7a51050e1915808ae39b3875acd5202ba19aed52b50fb21a3a8bada7a490c61c",
      "media_type": "application/json",
      "path": "summary.json",
      "role": "summary"
    },
    {
      "digest": "sha256:98f990a0f59db4ef15b7865365e487e3c3bed36645bfb706ebc7a63857cfef01",
      "media_type": "application/json",
      "path": "findings.json",
      "role": "findings"
    },
    {
      "digest": "sha256:e6310b05a086fe7c86bf95b1abd6eb8cc64d84473a06239a6704883f02b57e52",
      "media_type": "application/json",
      "path": "meta.json",
      "role": "meta"
    },
    {
      "digest": "sha256:1771802dafe6ab85552a00c6aaa094fe5d467ddb4edf770fb6aaaa2cddbb7c7d",
      "media_type": "application/json",
      "path": "spend.json",
      "role": "spend"
    },
    {
      "digest": "sha256:a06b03220e736f34c9e2aeb0dcc88c19b07515ed5aa65c530c4f557bc0292319",
      "media_type": "application/jsonl",
      "path": "result.jsonl",
      "role": "result"
    },
    {
      "digest": "sha256:07efc5c36fafa7872e859a91be079c03422d5a98a35bf785bdd166349761864d",
      "media_type": "text/plain",
      "path": "stderr.txt",
      "role": "stderr"
    },
    {
      "digest": "sha256:3f59eebb031d48293ffdb7a6c89ef022088a2f1c288ce6ef2f5431b9f9089412",
      "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:53:48Z",
    "started_at": "2026-08-31T17:48:42Z",
    "wall_seconds": 306.0
  },
  "extensions": {
    "afi": {
      "found_per_pass": {
        "agent": 9
      },
      "passes": null,
      "review_seconds": 304.104,
      "tier1_only": false,
      "variant_hash": null
    }
  },
  "findings": {
    "items": [
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "values()` reads `sweep_bytes_reclaimed` and `sweep_blobs_removed` in the opposite order to `COUNTERS` (lines 51-57), so the `/metrics` endpoint renders the blob count under\u2026\n\nvalues()` reads `sweep_bytes_reclaimed` and `sweep_blobs_removed` in the opposite order to `COUNTERS` (lines 51-57), so the `/metrics` endpoint renders the blob count under `cairn_proxy_sweep_bytes_reclaimed_total` and the byte count under `cairn_proxy_sweep_blobs_removed_total`. docs/operations.md directs operators to alert on `cairn_proxy_sweep_bytes_reclaimed_total`, so the alert would fire on blobs instead of bytes \u2014 the exact mis-rendering the comment at line 30-32 claims the side-by-side layout prevents.",
        "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": "the admin route calls `app.sweeper.sweep(dry_run)` directly, bypassing the `running` mutex that only `Sweeper::run` (sweep.rs:83) takes.\n\nAn operator-triggered sweep runs concurrently with the background sweep \u2014 exactly the \"two of them over one directory\" interference the module doc (sweep.rs:10-12) promises the type prevents. Both compute `held`/`remaining` from totals the other is concurrently shrinking, so together they can delete roughly twice the excess, dropping the store far below the ceiling either aimed at.",
        "id": "f2",
        "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": "forget(&index, &gone)` runs unconditionally, but in dry-run mode `gone` is still populated (line 137) while the blob removals were skipped \u2014 so `?dry_run=true`, which docs/architecture.md and the\u2026\n\nforget(&index, &gone)` runs unconditionally, but in dry-run mode `gone` is still populated (line 137) while the blob removals were skipped \u2014 so `?dry_run=true`, which docs/architecture.md and the route doc promise removes \"without removing anything\", actually deletes the index entries for every blob a sweep would reclaim. Those coordinates then resolve as misses and refetch until relinked, so a \"dry\" probe churns the cache it was meant to size.",
        "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": "clear_partials` unlinks every file in `incoming`, including temp files of fetches still in flight \u2014 `BlobWriter` (store.rs:171-180) and `BlobStore::link`'s index temp (store.rs:147-152) both live\u2026\n\nclear_partials` unlinks every file in `incoming`, including temp files of fetches still in flight \u2014 `BlobWriter` (store.rs:171-180) and `BlobStore::link`'s index temp (store.rs:147-152) both live there while active. The unlink doesn't kill the write (the fd stays valid), but `commit`'s rename (store.rs:259) then fails with ENOENT and the client's fully-downloaded artifact returns a storage 500. The comment at lines 220-223 (\"A file in `incoming` is a fetch that is not coming back\") is wrong for any fetch mid-download when the sweep fires.",
        "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": "run()` executes the fully synchronous `self.sweep(false)` \u2014 a recursive `std::fs` walk that the module doc itself sizes at sixty-five thousand directories \u2014 directly on a tokio worker thread.\n\nEvery cache request stalls behind it for the duration of the walk, and the `running` mutex is held across it so an admin sweep queues too. `spawn_blocking` is the fix the doc argues for and then doesn't apply.",
        "id": "f5",
        "locations": [
          {
            "end_line": 84,
            "path": "services/proxy/src/sweep.rs",
            "start_line": 84
          }
        ],
        "severity": "bug",
        "title": "bug"
      },
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "fs::metadata` follows symlinks, so a linked-in blob is counted at its target's size, contradicting the comment at lines 160-163 which claims `symlink_metadata` behavior; and since `meta.is_dir()`\u2026\n\nfs::metadata` follows symlinks, so a linked-in blob is counted at its target's size, contradicting the comment at lines 160-163 which claims `symlink_metadata` behavior; and since `meta.is_dir()` recurses, a symlink loop under `blobs/sha256` makes `collect` recurse until the stack overflows, aborting the process.",
        "id": "f6",
        "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": "a blob committed at cache.rs:151 is not indexed until `link` at cache.rs:163, with a registry round-trip between; a sweep in that window classifies it as unreferenced and deletes it, so the miss\u2026\n\na blob committed at cache.rs:151 is not indexed until `link` at cache.rs:163, with a registry round-trip between; a sweep in that window classifies it as unreferenced and deletes it, so the miss path's reopen at cache.rs:90-97 fails and the client gets the \"blob committed by this request is already missing\" 500 instead of the artifact it just downloaded.",
        "id": "f7",
        "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": "when `fs::remove_file` fails, the blob stays on disk but `remaining`, `bytes`, `removed` and `gone` are all still updated, so the metrics and the route response overcount what was reclaimed and\u2026\n\nwhen `fs::remove_file` fails, the blob stays on disk but `remaining`, `bytes`, `removed` and `gone` are all still updated, so the metrics and the route response overcount what was reclaimed and `forget` (line 140) deletes index entries naming a blob that still exists.",
        "id": "f8",
        "locations": [
          {
            "end_line": 126,
            "path": "services/proxy/src/sweep.rs",
            "start_line": 126
          }
        ],
        "severity": "bug",
        "title": "bug"
      },
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "tokio::time::interval`'s first tick completes immediately, not \"one interval away\" as the doc comment at lines 101-102 claims \u2014 a proxy that restarts sweeps a store it has not yet touched, the\u2026\n\ntokio::time::interval`'s first tick completes immediately, not \"one interval away\" as the doc comment at lines 101-102 claims \u2014 a proxy that restarts sweeps a store it has not yet touched, the protection the comment describes does not exist. Skipping the first tick (or sleeping first) would be needed for the stated behaviour.",
        "id": "f9",
        "locations": [
          {
            "end_line": 108,
            "path": "services/proxy/src/main.rs",
            "start_line": 108
          }
        ],
        "severity": "bug",
        "title": "bug"
      }
    ],
    "problems": [],
    "state": "measured"
  },
  "harness": {
    "adapter": {
      "digest": "sha256:a1a935298956020ee6d767a756847abb4c00694c88c2eb80d454886ebc4acf8c",
      "id": "afi",
      "version": "1"
    },
    "commit": "d5372b5a9797137af68e35c478f308f58ca4510c",
    "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": "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.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.0317441
    },
    "seconds": {
      "reason": null,
      "state": "measured",
      "unit": "seconds",
      "value": 306.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.5
    },
    "tokens": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 69713
    },
    "total_bill": {
      "reason": null,
      "state": "measured",
      "unit": "usd",
      "value": 0.0317441
    },
    "unkeyed": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 0
    }
  },
  "producer": {
    "commit": "d5372b5a9797137af68e35c478f308f58ca4510c",
    "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/glm-5.3-flash/20260831T173718Z",
  "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": "20260831T173718Z",
  "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": 241920,
      "input_tokens": 68640,
      "models": null,
      "output_tokens": 1073,
      "reasoning_tokens": 28354,
      "requests": 11,
      "stages": []
    }
  }
}
