{
  "assessment": {
    "decisions": [
      {
        "decided_by": "locality",
        "defect_id": "1",
        "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": "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
      }
    ],
    "judge": null,
    "judged": false,
    "scorer": {
      "commit": "631c4107752a97104719622800c9815e030613cf",
      "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": "9e4eff5e45f8",
    "label": "default",
    "models": [
      {
        "effort": "high",
        "model": "anthropic/claude-sonnet-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:1a97e71af9ae78b5f65fd85021a7f4411f12138c675ae6e9ed4fe7c23d6013ba",
      "media_type": "application/json",
      "path": "summary.json",
      "role": "summary"
    },
    {
      "digest": "sha256:9750a89c17b7bca2d00aecf3a5d9290f670a520e6f9b278c01109f0f3b44fbf6",
      "media_type": "application/json",
      "path": "findings.json",
      "role": "findings"
    },
    {
      "digest": "sha256:8f1d7bef8315a0c353094100a1022544433a042d37d9b4f53b1061442ad6817f",
      "media_type": "application/json",
      "path": "meta.json",
      "role": "meta"
    },
    {
      "digest": "sha256:ccee628b3608a0d4eb0a2f1b63d2b092d99b62441433502eba8d18f85f6245d9",
      "media_type": "application/json",
      "path": "spend.json",
      "role": "spend"
    },
    {
      "digest": "sha256:e4fe39598cfb3213001a3777df2192a8fa72bc5fda9dc9916fd065301d28d1fe",
      "media_type": "application/jsonl",
      "path": "result.jsonl",
      "role": "result"
    },
    {
      "digest": "sha256:3fe80665bd58f155d51189607d197e6c9a7631767b19f3eaed90dc008142dd0e",
      "media_type": "text/plain",
      "path": "stderr.txt",
      "role": "stderr"
    },
    {
      "digest": "sha256:7a28bd71b279c5651f474108eb3c8b53bac84bc98a4609629aaff6edfb529de9",
      "media_type": "application/gzip",
      "path": "afi-home/logs.tar.gz",
      "role": "traffic"
    }
  ],
  "execution": {
    "billing_limit_usd": 8.0,
    "budget_usd": 8.0,
    "deadline_exceeded": false,
    "exit_code": 0,
    "finished_at": "2026-08-31T14:49:58Z",
    "started_at": "2026-08-31T14:44:56Z",
    "wall_seconds": 301.0
  },
  "extensions": {
    "afi": {
      "found_per_pass": {
        "agent": 4
      },
      "passes": null,
      "review_seconds": 300.294,
      "tier1_only": false,
      "variant_hash": null
    }
  },
  "findings": {
    "items": [
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "candidates.sort_by_key(|candidate| candidate.age)` sorts ascending, so the smallest `age` (most recently modified, i.e. newest) blob is first and the largest `age` (oldest, longest-unwanted) blob is\u2026\n\ncandidates.sort_by_key(|candidate| candidate.age)` sorts ascending, so the smallest `age` (most recently modified, i.e. newest) blob is first and the largest `age` (oldest, longest-unwanted) blob is last. The removal loop that follows walks the vector front-to-back and stops once `remaining < self.max_bytes`, so it evicts the *newest* blobs first and leaves the truly stale ones in place until every newer blob has already gone \u2014 the opposite of the \"oldest blobs go, this morning's fetch stays\" behaviour the comment above it and `docs/operations.md`/`docs/architecture.md` describe. Fix by sorting oldest-first, e.g. `sort_by_key(|c| std::cmp::Reverse(c.age))`.",
        "id": "f1",
        "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": "forget(&index, &gone)` runs unconditionally, even when `dry_run` is true.\n\n`gone` is populated for every candidate that satisfied the `remove` condition regardless of `dry_run` (the file removal itself is the only thing gated on `!dry_run`, at line 125), so a dry run actually deletes the on-disk index-entry files for those digests via `fs::remove_file` inside `forget`. This contradicts the documented contract that `?dry_run=true` \"reports what a sweep would reclaim without removing anything\" (docs/operations.md, routes/admin.rs:58-60) \u2014 a preview call leaves the store's index mutated.",
        "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": "The order of `values()` (`sweep_bytes_reclaimed` then `sweep_blobs_removed`) does not match the order of `COUNTERS` (`cairn_proxy_sweep_blobs_removed_total` then\u2026\n\nThe order of `values()` (`sweep_bytes_reclaimed` then `sweep_blobs_removed`) does not match the order of `COUNTERS` (`cairn_proxy_sweep_blobs_removed_total` then `cairn_proxy_sweep_bytes_reclaimed_total`, metrics.rs:50-57), so `render()` zips them and prints the bytes-reclaimed value under the `..._blobs_removed_total` name and the blobs-removed value under `..._bytes_reclaimed_total`. This is exactly the mistake the adjacent doc comment (\"Keeping the two side by side is what stops a fifth counter from being rendered under a fourth one's name\") warns against, and it breaks the alert `docs/operations.md` tells operators to watch (`cairn_proxy_sweep_bytes_reclaimed_total`), since that metric will actually be a blob count.",
        "id": "f3",
        "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 on-demand sweep route calls `app.sweeper.sweep(dry_run)` directly instead of `app.sweeper.run()`, bypassing the `running: Mutex<()>` in `Sweeper` (services/proxy/src/sweep.rs:67,82-85) that the\u2026\n\nThe on-demand sweep route calls `app.sweeper.sweep(dry_run)` directly instead of `app.sweeper.run()`, bypassing the `running: Mutex<()>` in `Sweeper` (services/proxy/src/sweep.rs:67,82-85) that the module's own doc comment (sweep.rs:10-12) says exists to guarantee \"one sweep at a time.\" A request to `POST /v1/admin/cache/sweep` while the background interval sweep (main.rs:116, via `Sweeper::run`) is in flight runs concurrently against the same directory, which per the module's own reasoning can \"take the store far below the ceiling either was aiming at.\"",
        "id": "f4",
        "locations": [
          {
            "end_line": 76,
            "path": "services/proxy/src/routes/admin.rs",
            "start_line": 76
          }
        ],
        "severity": "bug",
        "title": "bug"
      }
    ],
    "problems": [],
    "state": "measured"
  },
  "harness": {
    "adapter": {
      "digest": "sha256:a1a935298956020ee6d767a756847abb4c00694c88c2eb80d454886ebc4acf8c",
      "id": "afi",
      "version": "1"
    },
    "commit": "631c4107752a97104719622800c9815e030613cf",
    "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": "sonnet-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.23076923076923078
    },
    "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.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": 4
    },
    "found": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 4
    },
    "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": 16
    },
    "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.2
    },
    "review_bill": {
      "reason": null,
      "state": "measured",
      "unit": "usd",
      "value": 0.513286
    },
    "seconds": {
      "reason": null,
      "state": "measured",
      "unit": "seconds",
      "value": 301.0
    },
    "tier_1": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.3333333333333333
    },
    "tier_2": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.14285714285714285
    },
    "tier_3": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.3333333333333333
    },
    "tier_4": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.0
    },
    "tokens": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 119880
    },
    "total_bill": {
      "reason": null,
      "state": "measured",
      "unit": "usd",
      "value": 0.513286
    },
    "unkeyed": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 0
    }
  },
  "producer": {
    "commit": "631c4107752a97104719622800c9815e030613cf",
    "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/sonnet-5/20260831T144453Z",
  "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": "20260831T144453Z",
  "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": 118133,
      "models": null,
      "output_tokens": 1747,
      "reasoning_tokens": 25955,
      "requests": 4,
      "stages": []
    }
  }
}
