{
  "assessment": {
    "decisions": [
      {
        "decided_by": "locality",
        "defect_id": "13",
        "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": "scorer",
        "defect_id": null,
        "finding_id": "f3",
        "id": "d3",
        "outcome": "rejected",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "11",
        "finding_id": "f4",
        "id": "d4",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "17",
        "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": "4",
        "finding_id": "f7",
        "id": "d7",
        "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:0b375c176df71520283ec2401b9c18de6bf5ff55e3bbe3bf388fe5ab8f17605f",
      "media_type": "application/json",
      "path": "summary.json",
      "role": "summary"
    },
    {
      "digest": "sha256:83c1475208a710b81be2d3449e51f495edeeb2fb95cec52b35239a9d4d5b3b01",
      "media_type": "application/json",
      "path": "findings.json",
      "role": "findings"
    },
    {
      "digest": "sha256:a62f3f958a434663ec07eac8d5fe06b08be8fd31758e65e5d7ae5a599513be53",
      "media_type": "application/json",
      "path": "meta.json",
      "role": "meta"
    },
    {
      "digest": "sha256:b8ccbd099b70cc11e48231a3e9a21d262157af8618f432f734b852715a0afcea",
      "media_type": "application/json",
      "path": "spend.json",
      "role": "spend"
    },
    {
      "digest": "sha256:21c9721c821b870384f0074ed56e40514e838a2ce8704f373046fd7e009bc055",
      "media_type": "application/jsonl",
      "path": "result.jsonl",
      "role": "result"
    },
    {
      "digest": "sha256:f314cac6108eae0629c6ab4d22d03b83d58aa289ad4cb5f2b5095f4eb90e3065",
      "media_type": "text/plain",
      "path": "stderr.txt",
      "role": "stderr"
    },
    {
      "digest": "sha256:f90cff3836f6c1d1c213ca482079db47b71f6e1ade07be9c722b3cca1bd8dc49",
      "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:45:16Z",
    "started_at": "2026-08-31T17:42:47Z",
    "wall_seconds": 149.0
  },
  "extensions": {
    "afi": {
      "found_per_pass": {
        "agent": 7
      },
      "passes": null,
      "review_seconds": 148.504,
      "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` then `sweep_blobs_removed`, but `COUNTERS` (lines 50-57) lists `..._blobs_removed_total` first, and `render` zips the two \u2014 each scrape renders the byte\u2026\n\nvalues()` returns `sweep_bytes_reclaimed` then `sweep_blobs_removed`, but `COUNTERS` (lines 50-57) lists `..._blobs_removed_total` first, and `render` zips the two \u2014 each scrape renders the byte count under `cairn_proxy_sweep_blobs_removed_total` and the blob count under `..._bytes_reclaimed_total`. Operations.md tells operators to alert on `cairn_proxy_sweep_bytes_reclaimed_total`, which would actually report blob counts.",
        "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": "forget(&index, &gone)` runs unconditionally, but `gone` is populated even when `dry_run` is true (line 137), and `forget` really deletes the index files (line 252).\n\nA `?dry_run=true` sweep \u2014 documented as reporting \"without removing anything\" (admin.rs, operations.md) \u2014 deletes index entries for blobs a hypothetical sweep would remove, turning \"would be reclaimed\" into \"will be reclaimed\": the surviving blobs become unreferenced and the next real sweep takes 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": "reclaim` calls `app.sweeper.sweep(dry_run)` directly, bypassing the `running` mutex that `Sweeper::run` (sweep.rs:82-85) exists to take.\n\nAn on-demand sweep therefore runs concurrently with the background sweep \u2014 both compute `held` from the same store and each evicts down to the ceiling, taking the store far below the ceiling either aimed at, exactly the failure the module doc (sweep.rs:10-12) says the type prevents.",
        "id": "f3",
        "locations": [
          {
            "end_line": 76,
            "path": "services/proxy/src/admin.rs",
            "start_line": 76
          }
        ],
        "severity": "bug",
        "title": "bug"
      },
      {
        "attributes": {
          "category": "performance",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "run` is `async` but calls the fully synchronous `self.sweep(false)` \u2014 a blocking recursive `read_dir`/`remove_file` walk over up to tens of thousands of files \u2014 directly on a tokio worker thread\u2026\n\nrun` is `async` but calls the fully synchronous `self.sweep(false)` \u2014 a blocking recursive `read_dir`/`remove_file` walk over up to tens of thousands of files \u2014 directly on a tokio worker thread (spawned at main.rs:116), stalling that worker for the whole pass instead of using `tokio::task::spawn_blocking`. The module doc rejects `tokio::fs` per-call overhead but not the blocking-the-executor cost; the route handler (admin.rs:76) blocks a worker the same way inside an async request.",
        "id": "f4",
        "locations": [
          {
            "end_line": 84,
            "path": "services/proxy/src/sweep.rs",
            "start_line": 84
          }
        ],
        "severity": "performance",
        "title": "performance"
      },
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "clear_partials` removes every file in `incoming` with no age check, but `incoming` is also where live downloads are written (`temp_path`, store.rs:201-206, files that persist for the up-to-30s\u2026\n\nclear_partials` removes every file in `incoming` with no age check, but `incoming` is also where live downloads are written (`temp_path`, store.rs:201-206, files that persist for the up-to-30s `fetch_timeout`). A sweep concurrent with traffic unlinks temp files of in-flight fetches; the writer keeps writing to the unlinked inode and `commit`'s rename fails (store.rs:259), so clients get 500s. The comment's premise (\"a file in `incoming` is a fetch that is not coming back\") is false for fetches still in flight.",
        "id": "f5",
        "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": "a blob with no index entry is removed regardless of age.\n\nBetween `writer.commit()` (cache.rs:151) and `store.link()` (cache.rs:163) there is a window \u2014 the registry registration network call \u2014 during which the just-committed blob is on disk but unreferenced, so a sweep in that window deletes it and the client gets the \"blob committed by this request is already missing\" 500 (cache.rs:90-97). The min-age grace period is documented as covering \"a package one job in a pipeline fetched\" but does not cover this case.",
        "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": "fs::metadata` follows symlinks, so the comment's claim that \"a link is counted at the size of the link and not of whatever it points at\" is false \u2014 linked-in blobs are counted at their target's full\u2026\n\nfs::metadata` follows symlinks, so the comment's claim that \"a link is counted at the size of the link and not of whatever it points at\" is false \u2014 linked-in blobs are counted at their target's full size (over-counting toward eviction), and a symlinked directory is recursed into (line 168), which on a link pointing back up the tree never terminates. `symlink_metadata` plus a link/skip decision is what the comment describes.",
        "id": "f7",
        "locations": [
          {
            "end_line": 164,
            "path": "services/proxy/src/sweep.rs",
            "start_line": 164
          }
        ],
        "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.38461538461538464
    },
    "category_maintainability": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.0
    },
    "category_performance": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.0
    },
    "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": 7
    },
    "found": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 6
    },
    "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": 14
    },
    "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.3
    },
    "review_bill": {
      "reason": null,
      "state": "measured",
      "unit": "usd",
      "value": 0.0154228
    },
    "seconds": {
      "reason": null,
      "state": "measured",
      "unit": "seconds",
      "value": 149.0
    },
    "tier_1": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.0
    },
    "tier_2": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.14285714285714285
    },
    "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": 46500
    },
    "total_bill": {
      "reason": null,
      "state": "measured",
      "unit": "usd",
      "value": 0.0154228
    },
    "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/20260831T173716Z",
  "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": "20260831T173716Z",
  "status": {
    "reason": null,
    "state": "completed"
  },
  "target": {
    "base_sha": null,
    "diff_digest": "sha256:eb6648de72c2c54842f91c28e6791a83b671f33293da0f76aeef42c320108ec8",
    "pull_request": 8,
    "repository_url": "https://github.com/smykla-skalski/cairn",
    "reviewed_sha": "9b51f95ef609a219e211e37b082cd2e6913190e0"
  },
  "usage": {
    "reason": null,
    "state": "measured",
    "value": {
      "cached_input_tokens": 57600,
      "input_tokens": 45862,
      "models": null,
      "output_tokens": 638,
      "reasoning_tokens": 13493,
      "requests": 4,
      "stages": []
    }
  }
}
