{
  "assessment": {
    "decisions": [
      {
        "decided_by": "locality",
        "defect_id": "13",
        "finding_id": "f1",
        "id": "d1",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "17",
        "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": "11",
        "finding_id": "f4",
        "id": "d4",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "6",
        "finding_id": "f5",
        "id": "d5",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "18",
        "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": "4",
        "finding_id": "f8",
        "id": "d8",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "scorer",
        "defect_id": null,
        "finding_id": "f9",
        "id": "d9",
        "outcome": "rejected",
        "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:4dc0357642beb2fb49293338d1d3ee73d3b8f34b263069a1435bb9c09787f55c",
      "media_type": "application/json",
      "path": "summary.json",
      "role": "summary"
    },
    {
      "digest": "sha256:8fc1aec22e9146145d3048913366ab9e26b41dbebd535598261a72ca5098ddb6",
      "media_type": "application/json",
      "path": "findings.json",
      "role": "findings"
    },
    {
      "digest": "sha256:4f2ee73e1789c65da732b39eb47f0474743b7459d3997a1c5acec507647bdc33",
      "media_type": "application/json",
      "path": "meta.json",
      "role": "meta"
    },
    {
      "digest": "sha256:8d7919c59bbc06336eb7c7915e99a3f49d89f6374f3943b5b90a82b810e4f93a",
      "media_type": "application/json",
      "path": "spend.json",
      "role": "spend"
    },
    {
      "digest": "sha256:f0526280d16b95f2cf99e43a5f93e0e22a35bf9bbb8214c82fa6d05d5ce6175a",
      "media_type": "application/jsonl",
      "path": "result.jsonl",
      "role": "result"
    },
    {
      "digest": "sha256:dc282e5601e5df90181601090b04c290a1c6dd9ae704bb1a47ded1f3e41a6a78",
      "media_type": "text/plain",
      "path": "stderr.txt",
      "role": "stderr"
    },
    {
      "digest": "sha256:5d840a5585a648716e7e6f56d9dc3abc774160f12a98608600468ddfde00801e",
      "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:48:01Z",
    "started_at": "2026-08-31T17:46:02Z",
    "wall_seconds": 119.0
  },
  "extensions": {
    "afi": {
      "found_per_pass": {
        "agent": 9
      },
      "passes": null,
      "review_seconds": 115.732,
      "tier1_only": false,
      "variant_hash": null
    }
  },
  "findings": {
    "items": [
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "values()` returns `sweep_bytes_reclaimed` and `sweep_blobs_removed` in the opposite order to `COUNTERS` (metrics.rs:51-57), so `render()`'s zip publishes the blob count under\u2026\n\nvalues()` returns `sweep_bytes_reclaimed` and `sweep_blobs_removed` in the opposite order to `COUNTERS` (metrics.rs:51-57), so `render()`'s zip publishes the blob count under `cairn_proxy_sweep_bytes_reclaimed_total` and the byte count under `cairn_proxy_sweep_blobs_removed_total`. operations.md tells operators to alert on the bytes counter specifically, so the alert reads blob counts (e.g. 12 blobs) as bytes reclaimed.",
        "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": "clear_partials` unlinks every file in `incoming/` with no age check, but that is where `BlobWriter` (store.rs:201-206) keeps the temp file of a fetch currently in progress.\n\nA 200 MiB download spanning a sweep loses its file mid-write; `commit`'s rename then fails on a path that no longer exists and the whole fetch errors after all bytes were transferred. Every sweep interval kills every in-flight download.",
        "id": "f2",
        "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": "forget(&index, &gone)` runs unconditionally, including for a dry run, so `?dry_run=true` \u2014 documented in admin.rs:58-60 as reporting what a sweep \"would reclaim without removing anything\" \u2014 still\u2026\n\nforget(&index, &gone)` runs unconditionally, including for a dry run, so `?dry_run=true` \u2014 documented in admin.rs:58-60 as reporting what a sweep \"would reclaim without removing anything\" \u2014 still deletes the index entries for every digest it would have removed. The dry run is a write, and each dry run forces a refetch (and re-link) of every blob it merely reported on.",
        "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": "the on-demand route calls `sweeper.sweep(dry_run)` directly instead of `sweeper.run().await`, bypassing the `running` mutex (sweep.rs:82-85) that exists precisely so two sweeps never interleave.\n\nA manual sweep concurrent with the background one makes both compute removals from a total the other is already shrinking, over-evicting past the ceiling and double-counting bytes in the 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": "the synchronous directory walk and unlinks (sweep.rs:90-149) run inline on a tokio worker thread; on a store with tens of thousands of blobs the module's own estimate (sweep.rs:14-17) this blocks a\u2026\n\nthe synchronous directory walk and unlinks (sweep.rs:90-149) run inline on a tokio worker thread; on a store with tens of thousands of blobs the module's own estimate (sweep.rs:14-17) this blocks a runtime worker for minutes while serving requests, and the route is deliberately exempted from the `TimeoutLayer` (routes/mod.rs:122-130) so nothing bounds it. It belongs in `run()` under `spawn_blocking` (or the lock held across a blocking task).",
        "id": "f5",
        "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": "a blob committed by an in-flight fetch between the `referenced()` snapshot (sweep.rs:92) and the unlink loop is absent from the index map and is deleted as unreachable, even though its index entry\u2026\n\na blob committed by an in-flight fetch between the `referenced()` snapshot (sweep.rs:92) and the unlink loop is absent from the index map and is deleted as unreachable, even though its index entry is written moments later \u2014 so `forget` (sweep.rs:140) then deletes that fresh entry too. On a long sweep of a busy store this evicts just-fetched packages, defeating the `CAIRN_CACHE_MIN_AGE` grace the docs promise.",
        "id": "f6",
        "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 (sweep.rs:126-131), the candidate is still counted: `remaining` is reduced, `bytes` and `removed` incremented, and its digest pushed to `gone`.\n\nA blob that was already gone via a purge gets reported as reclaimed bytes the store never gave up, and `remaining` then under-counts the true store size, letting a sweep stop while the store is still over its ceiling.",
        "id": "f7",
        "locations": [
          {
            "end_line": 134,
            "path": "services/proxy/src/sweep.rs",
            "start_line": 134
          }
        ],
        "severity": "bug",
        "title": "bug"
      },
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "fs::metadata` follows symlinks, so a symlinked blob is counted at its target's size, contradicting the comment at sweep.rs:160-163 which claims links are counted at the link's own size\u2026\n\nfs::metadata` follows symlinks, so a symlinked blob is counted at its target's size, contradicting the comment at sweep.rs:160-163 which claims links are counted at the link's own size (`fs::symlink_metadata` would be needed for that). A store assembled with hard/sym links is measured against the wrong total for the ceiling.",
        "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": "CAIRN_SWEEP_INTERVAL` is validated for zero but `CAIRN_CACHE_MIN_AGE` is not, so `CAIRN_CACHE_MIN_AGE=0` silently disables the grace period that operations.md presents as protecting a package\u2026\n\nCAIRN_SWEEP_INTERVAL` is validated for zero but `CAIRN_CACHE_MIN_AGE` is not, so `CAIRN_CACHE_MIN_AGE=0` silently disables the grace period that operations.md presents as protecting a package between pipeline jobs.",
        "id": "f9",
        "locations": [
          {
            "end_line": 131,
            "path": "services/proxy/src/config.rs",
            "start_line": 131
          }
        ],
        "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.46153846153846156
    },
    "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": 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.01440291
    },
    "seconds": {
      "reason": null,
      "state": "measured",
      "unit": "seconds",
      "value": 119.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": 40820
    },
    "total_bill": {
      "reason": null,
      "state": "measured",
      "unit": "usd",
      "value": 0.01440291
    },
    "unkeyed": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 1
    }
  },
  "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/20260831T173717Z",
  "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": "20260831T173717Z",
  "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": 64512,
      "input_tokens": 39997,
      "models": null,
      "output_tokens": 823,
      "reasoning_tokens": 12659,
      "requests": 5,
      "stages": []
    }
  }
}
