{
  "assessment": {
    "decisions": [
      {
        "decided_by": "scorer",
        "defect_id": null,
        "finding_id": "f1",
        "id": "d1",
        "outcome": "rejected",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "13",
        "finding_id": "f2",
        "id": "d2",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "17",
        "finding_id": "f3",
        "id": "d3",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "12",
        "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": "6",
        "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": "scorer",
        "defect_id": null,
        "finding_id": "f8",
        "id": "d8",
        "outcome": "rejected",
        "reason": null
      }
    ],
    "judge": null,
    "judged": false,
    "scorer": {
      "commit": "10b3b2068100b7ba429855e062500eaf83b90120",
      "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:e45a7407c8fa937dd9eb0fb362028ae6f58f02bf62bbb07890691008564fc845",
      "media_type": "application/json",
      "path": "summary.json",
      "role": "summary"
    },
    {
      "digest": "sha256:239d8acbbf198efad7e6344f1395512837a897c768eb6673c06055231c160ed8",
      "media_type": "application/json",
      "path": "findings.json",
      "role": "findings"
    },
    {
      "digest": "sha256:2efec1f15ef301b12177b285540a15bdc62cb3fbe6ec15f578d44dfb1b6e60f5",
      "media_type": "application/json",
      "path": "meta.json",
      "role": "meta"
    },
    {
      "digest": "sha256:60a1264d6afeecbd1f8d8b09cd65dfa89f91308212296f3270ddb7ac4b41795d",
      "media_type": "application/json",
      "path": "spend.json",
      "role": "spend"
    },
    {
      "digest": "sha256:dfdd0a4bf4d7a6d7e023d2348b7478d2ce3b934fd6ee70ac5f6ac2a6aec49ca1",
      "media_type": "application/jsonl",
      "path": "result.jsonl",
      "role": "result"
    },
    {
      "digest": "sha256:6ae10b696fefd8c46837133a6993c67135795853eb4c9bd12009cdd140510f6c",
      "media_type": "text/plain",
      "path": "stderr.txt",
      "role": "stderr"
    },
    {
      "digest": "sha256:f808e3d832c2b3dbbce442eb9a9908a116b2c7decc497221a730644c0ac08525",
      "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-31T11:23:32Z",
    "started_at": "2026-08-31T11:18:05Z",
    "wall_seconds": 328.0
  },
  "extensions": {
    "afi": {
      "found_per_pass": {
        "agent": 8
      },
      "passes": null,
      "review_seconds": 325.311,
      "tier1_only": false,
      "variant_hash": null
    }
  },
  "findings": {
    "items": [
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "Duration::from_hours` (and `from_mins` at line 84, plus the test uses at 350-351) do not exist on stable `std::time::Duration` \u2014 they are unstable `duration_constructors` methods, and\u2026\n\nDuration::from_hours` (and `from_mins` at line 84, plus the test uses at 350-351) do not exist on stable `std::time::Duration` \u2014 they are unstable `duration_constructors` methods, and `rust-toolchain.toml` pins `channel = \"stable\"` with no feature gate. The proxy does not compile; the whole sweep feature is dead on arrival.",
        "id": "f1",
        "locations": [
          {
            "end_line": 83,
            "path": "services/proxy/src/config.rs",
            "start_line": 83
          }
        ],
        "severity": "bug",
        "title": "bug"
      },
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "values()` returns `sweep_bytes_reclaimed` before `sweep_blobs_removed`, but `COUNTERS` (lines 51-57) lists `sweep_blobs_removed_total` before `sweep_bytes_reclaimed_total`, and `render` zips them\u2026\n\nvalues()` returns `sweep_bytes_reclaimed` before `sweep_blobs_removed`, but `COUNTERS` (lines 51-57) lists `sweep_blobs_removed_total` before `sweep_bytes_reclaimed_total`, and `render` zips them positionally. Each sweep counter is published under the other's name \u2014 `cairn_proxy_sweep_bytes_reclaimed_total`, the one docs/operations.md tells operators to alert on, actually carries the blob count. This is exactly the fifth-under-fourth's-name failure the adjacent comment (line 30-32) claims the pairing prevents.",
        "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": "clear_partials` unlinks every file in `incoming` with no age check, but `BlobWriter` (store.rs:171-180, 242-259) keeps an open temp file there for the whole of a download \u2014 minutes for a 200 MiB\u2026\n\nclear_partials` unlinks every file in `incoming` with no age check, but `BlobWriter` (store.rs:171-180, 242-259) keeps an open temp file there for the whole of a download \u2014 minutes for a 200 MiB artifact. A sweep concurrent with an in-flight fetch deletes that fetch's temp file, so `commit`'s rename fails and the download errors. `CAIRN_CACHE_MIN_AGE` is applied only to blobs, not partials, so even a temp file created seconds before is destroyed.",
        "id": "f3",
        "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, but `gone` is populated on dry runs too (line 137).\n\nA dry run \u2014 documented in docs/operations.md and on the route as reporting \"without removing anything\" \u2014 deletes the index entries of every blob it would have removed, degrading those coordinates to a miss-and-refetch the next time they are requested.",
        "id": "f4",
        "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 handler calls `app.sweeper.sweep(dry_run)` directly instead of `run()`, so it never takes the `running` mutex (sweep.rs:83) and can run concurrently with the 15-minute background sweep\u2026\n\nthe on-demand handler calls `app.sweeper.sweep(dry_run)` directly instead of `run()`, so it never takes the `running` mutex (sweep.rs:83) and can run concurrently with the 15-minute background sweep in main.rs:116 \u2014 the exact two-sweeps-over-one-directory hazard the module doc (sweep.rs:10-12, 65-67) claims the type prevents. Both compute `held` from the same starting total and remove independently, driving the store far below the ceiling and double-counting reclaimed bytes.",
        "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": "Sweeper::sweep` is a synchronous recursive walk plus per-blob unlinks, executed directly on a tokio worker thread \u2014 both here and via `run()` awaited in the spawned task (main.rs:116).\n\nOn a store of the size the module's own doc contemplates (65k leaf directories, sweep.rs:15), one sweep stalls a runtime worker for the duration, delaying every request multiplexed onto it. The sync-walk choice is defensible; running it outside `spawn_blocking` is the defect.",
        "id": "f6",
        "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": "when `fs::remove_file` fails, the candidate is still counted into `removed`, `bytes`, and `gone`, and its index entries are then deleted by `forget`.\n\nA persistent failure (permissions, read-only mount) inflates `sweep_bytes_reclaimed_total` on every sweep with bytes never reclaimed, and drops index entries for blobs that still exist, forcing a refetch of bytes that were present.",
        "id": "f7",
        "locations": [
          {
            "end_line": 130,
            "path": "services/proxy/src/sweep.rs",
            "start_line": 130
          }
        ],
        "severity": "bug",
        "title": "bug"
      },
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "an index entry that fails to read or parse is skipped, which leaves its digest absent from the `index` map \u2014 so the blob it points at satisfies `!index.contains_key(hex)` (line 119) and is deleted.\n\nThis is the opposite of the comment's stated intent (\"deciding here that it references no blob would delete the bytes that refetch is about to find\"); the consequence is one refetch per occurrence, tolerable but not what the code says it does.",
        "id": "f8",
        "locations": [
          {
            "end_line": 205,
            "path": "services/proxy/src/sweep.rs",
            "start_line": 205
          }
        ],
        "severity": "bug",
        "title": "bug"
      }
    ],
    "problems": [],
    "state": "measured"
  },
  "harness": {
    "adapter": {
      "digest": "sha256:a1a935298956020ee6d767a756847abb4c00694c88c2eb80d454886ebc4acf8c",
      "id": "afi",
      "version": "1"
    },
    "commit": "10b3b2068100b7ba429855e062500eaf83b90120",
    "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.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": 8
    },
    "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.023679463
    },
    "seconds": {
      "reason": null,
      "state": "measured",
      "unit": "seconds",
      "value": 328.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.5
    },
    "tier_4": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.25
    },
    "tokens": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 74100
    },
    "total_bill": {
      "reason": null,
      "state": "measured",
      "unit": "usd",
      "value": 0.023679463
    },
    "unkeyed": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 2
    }
  },
  "producer": {
    "commit": "10b3b2068100b7ba429855e062500eaf83b90120",
    "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/20260831T111210Z",
  "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": "20260831T111210Z",
  "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": 75776,
      "input_tokens": 73367,
      "models": null,
      "output_tokens": 733,
      "reasoning_tokens": 20633,
      "requests": 6,
      "stages": []
    }
  }
}
