{
  "assessment": {
    "decisions": [
      {
        "decided_by": "scorer",
        "defect_id": null,
        "finding_id": "f1",
        "id": "d1",
        "outcome": "rejected",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "11",
        "finding_id": "f2",
        "id": "d2",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "3",
        "finding_id": "f3",
        "id": "d3",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "5",
        "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": "13",
        "finding_id": "f6",
        "id": "d6",
        "outcome": "matched",
        "reason": null
      },
      {
        "decided_by": "locality",
        "defect_id": "10",
        "finding_id": "f7",
        "id": "d7",
        "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": "372d66bf0baf",
    "label": "default",
    "models": [
      {
        "effort": "high",
        "model": "moonshotai/kimi-k2.7-code",
        "protocol": null,
        "provider": "moonshotai",
        "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:0e41e8ca57aeaa16dba7b62ece12356e52823ecb37727052e39a14716138a25f",
      "media_type": "application/json",
      "path": "summary.json",
      "role": "summary"
    },
    {
      "digest": "sha256:08a1c68ab9a0b1669ba8e157c85a69f771c48017be2c1c5be6c55e78b9aa41ee",
      "media_type": "application/json",
      "path": "findings.json",
      "role": "findings"
    },
    {
      "digest": "sha256:e3b49e4260384078e4f725edc30d992c2e7c05520b15155ef06988e8c917fc8e",
      "media_type": "application/json",
      "path": "meta.json",
      "role": "meta"
    },
    {
      "digest": "sha256:45b5a623101eb2dc93829a4ed57595bf4688ee41c6e594a7e808457704944e59",
      "media_type": "application/json",
      "path": "spend.json",
      "role": "spend"
    },
    {
      "digest": "sha256:61e20e20ea5329c23722d35be4f2353b619bfc41d066908b242ccc0451feff13",
      "media_type": "application/jsonl",
      "path": "result.jsonl",
      "role": "result"
    },
    {
      "digest": "sha256:f380af28297727c23bbd0f35eca0fabfaae68f417ed63c7a8356f9f09b21c3b6",
      "media_type": "text/plain",
      "path": "stderr.txt",
      "role": "stderr"
    },
    {
      "digest": "sha256:555ebe9457a392124b4b724b2542b93788ee9ac6b206d7c5f19eb8e557508a9b",
      "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:51:19Z",
    "started_at": "2026-08-31T11:48:21Z",
    "wall_seconds": 178.0
  },
  "extensions": {
    "afi": {
      "found_per_pass": {
        "agent": 7
      },
      "passes": null,
      "review_seconds": 177.201,
      "tier1_only": false,
      "variant_hash": null
    }
  },
  "findings": {
    "items": [
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "Duration::from_hours(1)` and `Duration::from_mins(15)` do not exist on `std::time::Duration`; this code does not compile.\n\n\ud83d\udd17 relevant also at services/proxy/src/config.rs:84, 350, 351.",
        "id": "f1",
        "locations": [
          {
            "end_line": 83,
            "path": "services/proxy/src/config.rs",
            "start_line": 83
          }
        ],
        "severity": "bug",
        "title": "bug"
      },
      {
        "attributes": {
          "category": "maintainability",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "Sweeper::sweep` is a synchronous filesystem walk called from an async handler (`admin::sweep` at services/proxy/src/routes/admin.rs:67) without `spawn_blocking`, blocking the Tokio runtime for the\u2026\n\nSweeper::sweep` is a synchronous filesystem walk called from an async handler (`admin::sweep` at services/proxy/src/routes/admin.rs:67) without `spawn_blocking`, blocking the Tokio runtime for the entire duration of a large store walk.",
        "id": "f2",
        "locations": [
          {
            "end_line": 90,
            "path": "services/proxy/src/sweep.rs",
            "start_line": 90
          }
        ],
        "severity": "maintainability",
        "title": "maintainability"
      },
      {
        "attributes": {
          "category": "bug",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "remaining` starts at `held` and is only decremented after a blob is chosen for removal, so the ceiling is compared against the pre-removal total.\n\nThe first iteration removes a blob even when `held == max_bytes`, which is correct, but the loop continues removing the oldest referenced blob one byte beyond the ceiling rather than stopping once `remaining < max_bytes`. More importantly, if `held` is already below `max_bytes`, the condition `remaining >= max_bytes` is false, so no unreferenced-blob removal happens by age\u2014but unreferenced blobs are still removed unconditionally, which is intended; the real issue is that with `held >= max_bytes`, after removing one blob, `remaining` becomes `held - size`, and if that is still >= max_bytes, another old blob is removed. This repeats until the total is strictly less than the ceiling, so the store can end up far below the configured ceiling when a single old blob is much smaller than the overage.",
        "id": "f3",
        "locations": [
          {
            "end_line": 120,
            "path": "services/proxy/src/sweep.rs",
            "start_line": 119
          }
        ],
        "severity": "bug",
        "title": "bug"
      },
      {
        "attributes": {
          "category": "maintainability",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "age_of` returns `Duration::default()` when `modified()` is missing or in the future, treating every such blob as age zero.\n\nA blob with a bad timestamp will then never be removed by age even if the store is over its ceiling, and may silently accumulate.",
        "id": "f4",
        "locations": [
          {
            "end_line": 189,
            "path": "services/proxy/src/sweep.rs",
            "start_line": 185
          }
        ],
        "severity": "maintainability",
        "title": "maintainability"
      },
      {
        "attributes": {
          "category": "maintainability",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "clear_partials` counts every entry in `incoming` as a removed partial even during a dry run, so `Reclaimed::partials` is non-zero in dry-run output even though nothing was deleted.",
        "id": "f5",
        "locations": [
          {
            "end_line": 240,
            "path": "services/proxy/src/sweep.rs",
            "start_line": 224
          }
        ],
        "severity": "maintainability",
        "title": "maintainability"
      },
      {
        "attributes": {
          "category": "maintainability",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "the values array and `COUNTERS` were expanded to six entries, but the order of the new sweep counters in `values()` does not match their order in `COUNTERS`: `COUNTERS` has bytes then blobs, but\u2026\n\nthe values array and `COUNTERS` were expanded to six entries, but the order of the new sweep counters in `values()` does not match their order in `COUNTERS`: `COUNTERS` has bytes then blobs, but `values()` loads bytes then blobs as well. (Actually both have bytes then blobs at offsets 4 and 5; no mismatch.) No finding here.",
        "id": "f6",
        "locations": [
          {
            "end_line": 96,
            "path": "services/proxy/src/metrics.rs",
            "start_line": 88
          }
        ],
        "severity": "maintainability",
        "title": "maintainability"
      },
      {
        "attributes": {
          "category": "maintainability",
          "confidence": null,
          "evidence_quote": null,
          "suggested_fix": null
        },
        "body": "reclaim` calls `app.sweeper.sweep(dry_run)` synchronously.\n\nBecause `sweep` performs blocking I/O on the async thread (see above) and is not `await`ed, this also bypasses the `Mutex` ordering established by `Sweeper::run`, though the same process mutex is still held.\n\n\ud83d\udfe2 `maintainability` services/proxy/src/sweep.rs:199-201: `referenced` reuses the generic recursive `collect`, which collects every file including non-JSON entries and directories; fine, but worth noting it also walks any stray directories under `index` and treats all files as candidate entries.\n\nNo other concrete defects identified.",
        "id": "f7",
        "locations": [
          {
            "end_line": 67,
            "path": "services/proxy/src/routes/admin.rs",
            "start_line": 67
          }
        ],
        "severity": "maintainability",
        "title": "maintainability"
      }
    ],
    "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": "kimi-k2.7-code",
  "metrics": {
    "anchor_max": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 1
    },
    "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.9859483
    },
    "seconds": {
      "reason": null,
      "state": "measured",
      "unit": "seconds",
      "value": 178.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.3333333333333333
    },
    "tier_4": {
      "reason": null,
      "state": "measured",
      "unit": "ratio",
      "value": 0.25
    },
    "tokens": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 286940
    },
    "total_bill": {
      "reason": null,
      "state": "measured",
      "unit": "usd",
      "value": 0.9859483
    },
    "unkeyed": {
      "reason": null,
      "state": "measured",
      "unit": "count",
      "value": 1
    }
  },
  "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/kimi-k2.7-code/20260831T111217Z",
  "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": "20260831T111217Z",
  "status": {
    "reason": null,
    "state": "completed"
  },
  "target": {
    "base_sha": null,
    "diff_digest": "sha256:48c8de650c43357df692dec10b766865ab79e903f62adae83d4cdea3ba7c30d6",
    "pull_request": 8,
    "repository_url": "https://github.com/smykla-skalski/cairn",
    "reviewed_sha": "9b51f95ef609a219e211e37b082cd2e6913190e0"
  },
  "usage": {
    "reason": null,
    "state": "measured",
    "value": {
      "cached_input_tokens": 4360960,
      "input_tokens": 283707,
      "models": null,
      "output_tokens": 3233,
      "reasoning_tokens": 9312,
      "requests": 62,
      "stages": []
    }
  }
}
