{
  "assessment": {
    "decisions": [
      {
        "decided_by": "locality",
        "defect_id": "6",
        "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": "11",
        "finding_id": "f3",
        "id": "d3",
        "outcome": "matched",
        "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": "39fb05463232",
    "label": "default",
    "models": [
      {
        "effort": "high",
        "model": "z-ai/glm-5.2",
        "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:f56bd84c9f0024c95e2c572908723ba414dadf91e73214bfc5504d6b196af0bb",
      "media_type": "application/json",
      "path": "summary.json",
      "role": "summary"
    },
    {
      "digest": "sha256:1fff7c0a79a9b5814935862dc0449fd3615d680b61fca5d2d184b4016de96138",
      "media_type": "application/json",
      "path": "findings.json",
      "role": "findings"
    },
    {
      "digest": "sha256:662e72dee15558eb3316e8832a8a4c0f8f2a2eb07ca9dc590e461f05d61c6d5f",
      "media_type": "application/json",
      "path": "meta.json",
      "role": "meta"
    },
    {
      "digest": "sha256:9258d2cc6d2089c7bfa1845af7fb7f9e48986997d6167ff543c6bbdee0c16b8f",
      "media_type": "application/json",
      "path": "spend.json",
      "role": "spend"
    },
    {
      "digest": "sha256:c06c897f32832c9b78c08686019eefd711b3d09a85c1c8d9385946fe704d0abd",
      "media_type": "application/jsonl",
      "path": "result.jsonl",
      "role": "result"
    },
    {
      "digest": "sha256:f92076ff7e9ec519ce4a94e2f565b3bfff6b7ef571198c88f2f6e9b8b877d714",
      "media_type": "text/plain",
      "path": "stderr.txt",
      "role": "stderr"
    },
    {
      "digest": "sha256:bf7f6c37351bd9135a66f7261ff6ac70272f83c10b2f0c93ba1cfb6f64e75748",
      "media_type": "application/gzip",
      "path": "afi-home/logs.tar.gz",
      "role": "traffic"
    }
  ],
  "execution": {
    "billing_limit_usd": 2.0,
    "budget_usd": 2.0,
    "deadline_exceeded": false,
    "exit_code": 0,
    "finished_at": "2026-08-31T11:57:20Z",
    "started_at": "2026-08-31T11:54:24Z",
    "wall_seconds": 176.0
  },
  "extensions": {
    "afi": {
      "found_per_pass": {
        "agent": 3
      },
      "passes": null,
      "review_seconds": 174.262,
      "tier1_only": false,
      "variant_hash": null
    }
  },
  "findings": {
    "items": [
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "the on-demand sweep calls `app.sweeper.sweep(dry_run)` directly instead of the locking `run()`, so an admin-triggered sweep runs concurrently with the background sweep.\n\n`Sweeper::sweep` (sweep.rs:90) takes no lock while `run` (sweep.rs:82-84) holds `running`; both walks compute `held` from the same files and each independently removes down to `cache_max_bytes`, so together they reclaim roughly twice the excess \u2014 exactly the \"far below the ceiling\" case the module doc at sweep.rs:10-12 says the mutex exists to prevent.",
        "id": "f1",
        "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": "clear_partials` deletes every file in `incoming` with no age check and no exclusion of files being written, so a sweep that fires while a fetch is in progress `fs::remove_file`s that fetch's temp\u2026\n\nclear_partials` deletes every file in `incoming` with no age check and no exclusion of files being written, so a sweep that fires while a fetch is in progress `fs::remove_file`s that fetch's temp file out from under its `BlobWriter`. On Unix the open fd keeps the writes alive, but `BlobWriter::commit`'s `fs::rename(&temp, &target)` (store.rs:259) then fails with `NotFound`, failing the in-flight download. The doc comment (\"a file in `incoming` is a fetch that is not coming back\") is only true for abandoned partials, not for the long-running 200 MiB fetches the cache is sized for.",
        "id": "f2",
        "locations": [
          {
            "end_line": 230,
            "path": "services/proxy/src/sweep.rs",
            "start_line": 230
          }
        ],
        "severity": "bug",
        "title": "bug"
      },
      {
        "attributes": {
          "category": "performance",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "sweep` performs the full walk (`read_dir`/`metadata`/`read`/`remove_file`) synchronously and is invoked from async contexts \u2014 the background task (main.rs:116 via `run`) and the admin handler\u2026\n\nsweep` performs the full walk (`read_dir`/`metadata`/`read`/`remove_file`) synchronously and is invoked from async contexts \u2014 the background task (main.rs:116 via `run`) and the admin handler (admin.rs:76) \u2014 without `spawn_blocking`, so a store walk over the 32 GiB ceiling blocks a tokio worker thread for the whole pass and stalls every other request sharing that thread. The module's justification (sweep.rs:14-18) argues the std calls are cheaper than `tokio::fs` scheduling, but the cost at issue is blocking the runtime, not the syscall count.\n\nNo findings.",
        "id": "f3",
        "locations": [
          {
            "end_line": 90,
            "path": "services/proxy/src/sweep.rs",
            "start_line": 90
          }
        ],
        "severity": "performance",
        "title": "performance"
      }
    ],
    "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.2",
  "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.15384615384615385
    },
    "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": 3
    },
    "found": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 3
    },
    "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": 17
    },
    "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.15
    },
    "review_bill": {
      "reason": null,
      "state": "measured",
      "unit": "usd",
      "value": 0.19782816
    },
    "seconds": {
      "reason": null,
      "state": "measured",
      "unit": "seconds",
      "value": 176.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.16666666666666666
    },
    "tier_4": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.25
    },
    "tokens": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 75330
    },
    "total_bill": {
      "reason": null,
      "state": "measured",
      "unit": "usd",
      "value": 0.19782816
    },
    "unkeyed": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 0
    }
  },
  "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.2/20260831T111219Z",
  "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": "20260831T111219Z",
  "status": {
    "reason": null,
    "state": "completed"
  },
  "target": {
    "base_sha": null,
    "diff_digest": "sha256:a3cf095ed82d5643981a187f69c8b8cc95b908f252d092a5b0c1ee142ae1980b",
    "pull_request": 8,
    "repository_url": "https://github.com/smykla-skalski/cairn",
    "reviewed_sha": "9b51f95ef609a219e211e37b082cd2e6913190e0"
  },
  "usage": {
    "reason": null,
    "state": "measured",
    "value": {
      "cached_input_tokens": 307584,
      "input_tokens": 74111,
      "models": null,
      "output_tokens": 1219,
      "reasoning_tokens": 9813,
      "requests": 16,
      "stages": []
    }
  }
}
