Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.
Python aicode-complexitycode-healthcode-intelligencecode-qualitydead-codedeveloper-toolsdocumentationgit-analyticsmcpopen-sourcepythonrefactoringstatic-analysistechnical-debt
{
"plans": [
{
"blast_radius": {
"call_sites": 3,
"file_count": 1,
"files": [
"src/app/jobs.py"
]
},
"confidence": "medium",
"evidence": {
"affected_files_total": 1,
"biomarker_type": "nested_loop_with_io",
"biomarker_types": [
"io_in_loop",
"nested_loop_with_io"
],
"boundary_kind": "db",
"execution_context": "production",
"observations_total": 3,
"provenance": "call-site",
"rank_factors": {
"affected_call_sites": 4,
"boundary_kind": 4,
"execution_context": 3,
"execution_role": 1,
"loop_magnitude": 0,
"multiplier_shape": 6,
"provenance": 3
},
"rank_score": 21,
"rationale": "The shared I/O sink is proven; no concrete batch API or result-equivalence proof is available.",
"reliable_entry_reachability": true
},
"file_path": "src/app/jobs.py",
"impact_delta": 0.0,
"line_end": 40,
"line_start": 40,
"plan": {
"affected_locations": [
{
"file_path": "src/app/jobs.py",
"function_name": "drain",
"line_end": 40,
"line_start": 40
},
{
"file_path": "src/app/jobs.py",
"function_name": "drain",
"line_end": 42,
"line_start": 42
},
{
"call": "save",
"file_path": "src/app/jobs.py",
"function_name": "drain",
"line_end": 44,
"line_start": 44
}
],
"affected_locations_total": 3,
"api": null,
"evidence_truncated": false,
"intervention_symbol": "src/app/jobs.py::drain",
"judgment_steps": 3,
"mechanical_steps": 0,
"opportunity_id": "perf3_d41b04897cfde2a9eed6",
"paths": [
[
"src/app/jobs.py::drain",
"src/app/db.py::save"
]
],
"paths_total": 3,
"safety": "advisory",
"steps": [
{
"action": "Collect the keys before the loop and replace the per-key database call with one batched call",
"applicability": "judgment",
"file_path": "src/app/jobs.py",
"line": 40,
"order": 1,
"symbol": "drain"
},
{
"action": "Collect the keys before the loop and replace the per-key database call with one batched call",
"applicability": "judgment",
"file_path": "src/app/jobs.py",
"line": 42,
"order": 2,
"symbol": "drain"
},
{
"action": "Collect the keys before the loop and replace the per-key save database call with one batched call",
"applicability": "judgment",
"file_path": "src/app/jobs.py",
"line": 44,
"order": 3,
"symbol": "drain"
}
],
"strategy": "batch_or_prefetch_io"
},
"refactoring_type": "performance_fix",
"source_biomarker": "nested_loop_with_io",
"target_symbol": "src/app/jobs.py::drain"
},
{
"blast_radius": {
"call_sites": 2,
"file_count": 1,
"files": [
"src/app/reindex.py"
]
},
"confidence": "medium",
"evidence": {
"affected_files_total": 1,
"biomarker_type": "nested_loop_with_io",
"biomarker_types": [
"io_in_loop",
"nested_loop_with_io"
],
"boundary_kind": "db",
"execution_context": "production",
"observations_total": 2,
"provenance": "call-site",
"rank_factors": {
"affected_call_sites": 3,
"boundary_kind": 4,
"execution_context": 3,
"execution_role": 1,
"loop_magnitude": 0,
"multiplier_shape": 6,
"provenance": 3
},
"rank_score": 20,
"rationale": "The shared I/O sink is proven; no concrete batch API or result-equivalence proof is available.",
"reliable_entry_reachability": null
},
"file_path": "src/app/reindex.py",
"impact_delta": 0.0,
"line_end": 212,
"line_start": 210,
"plan": {
"affected_locations": [
{
"call": "_write",
"file_path": "src/app/reindex.py",
"function_name": "one",
"line_end": 212,
"line_start": 210
},
{
"call": "_write",
"file_path": "src/app/reindex.py",
"function_name": "many",
"line_end": 217,
"line_start": 215
}
],
"affected_locations_total": 2,
"api": null,
"evidence_truncated": false,
"intervention_symbol": "src/app/reindex.py::_write",
"judgment_steps": 3,
"mechanical_steps": 0,
"opportunity_id": "perf3_a123c4c38fdb1cabaa6a",
"paths": [
[
"src/app/reindex.py::one",
"src/app/reindex.py::_write",
"src/app/db.py::upsert"
],
[
"src/app/reindex.py::many",
"src/app/reindex.py::_write",
"src/app/db.py::upsert"
]
],
"paths_total": 2,
"safety": "advisory",
"steps": [
{
"action": "Add a form of _write that takes every key at once",
"applicability": "judgment",
"file_path": "src/app/reindex.py",
"line": null,
"order": 1,
"symbol": "src/app/reindex.py::_write"
},
{
"action": "Collect the keys before the loop and replace the per-key _write database call with one batched call",
"applicability": "judgment",
"file_path": "src/app/reindex.py",
"line": 210,
"order": 2,
"symbol": "one"
},
{
"action": "Collect the keys before the loop and replace the per-key _write database call with one batched call",
"applicability": "judgment",
"file_path": "src/app/reindex.py",
"line": 215,
"order": 3,
"symbol": "many"
}
],
"strategy": "batch_or_prefetch_io"
},
"refactoring_type": "performance_fix",
"source_biomarker": "nested_loop_with_io",
"target_symbol": "src/app/reindex.py::_write"
},
{
"blast_radius": {
"call_sites": 1,
"file_count": 1,
"files": [
"src/app/owners.py"
]
},
"confidence": "high",
"evidence": {
"affected_files_total": 1,
"biomarker_type": "io_in_loop",
"biomarker_types": [
"io_in_loop"
],
"boundary_kind": "db",
"execution_context": "production",
"observations_total": 1,
"provenance": "direct",
"rank_factors": {
"affected_call_sites": 2,
"boundary_kind": 4,
"execution_context": 3,
"execution_role": 1,
"loop_magnitude": 2,
"multiplier_shape": 4,
"provenance": 3
},
"rank_score": 19,
"rationale": "Every call filters on the loop's own key, so .in_(\"repo_id\", keys) covers the same rows, and nothing else in the loop can observe the difference.",
"reliable_entry_reachability": null
},
"file_path": "src/app/owners.py",
"impact_delta": 0.0,
"line_end": 22,
"line_start": 20,
"plan": {
"affected_locations": [
{
"file_path": "src/app/owners.py",
"function_name": "load_owners",
"line_end": 22,
"line_start": 20
}
],
"affected_locations_total": 1,
"api": ".in_(\"repo_id\", keys)",
"evidence_truncated": false,
"intervention_symbol": "src/app/owners.py::load_owners",
"judgment_steps": 0,
"mechanical_steps": 1,
"opportunity_id": "perf3_83d258547498bed60226",
"paths": [],
"paths_total": 1,
"safety": "proven",
"steps": [
{
"action": "Collect the keys before the loop and make one call with .in_(\"repo_id\", keys) in place of the per-key database call",
"applicability": "mechanical",
"file_path": "src/app/owners.py",
"line": 20,
"order": 1,
"symbol": "load_owners"
}
],
"strategy": "batch_or_prefetch_io"
},
"refactoring_type": "performance_fix",
"source_biomarker": "io_in_loop",
"target_symbol": "src/app/owners.py::load_owners"
},
{
"blast_radius": {
"call_sites": 3,
"file_count": 1,
"files": [
"src/app/ledger.py"
]
},
"confidence": "medium",
"evidence": {
"affected_files_total": 1,
"biomarker_type": "io_in_loop",
"biomarker_types": [
"io_in_loop"
],
"boundary_kind": "db",
"execution_context": "production",
"observations_total": 3,
"provenance": "call-site",
"rank_factors": {
"affected_call_sites": 4,
"boundary_kind": 4,
"execution_context": 3,
"execution_role": 1,
"loop_magnitude": 0,
"multiplier_shape": 4,
"provenance": 3
},
"rank_score": 19,
"rationale": "The shared I/O sink is proven; no concrete batch API or result-equivalence proof is available.",
"reliable_entry_reachability": true
},
"file_path": "src/app/ledger.py",
"impact_delta": 0.0,
"line_end": 587,
"line_start": 587,
"plan": {
"affected_locations": [
{
"call": "_move",
"file_path": "src/app/ledger.py",
"function_name": "apply",
"line_end": 587,
"line_start": 587
},
{
"call": "_fold_one",
"file_path": "src/app/ledger.py",
"function_name": "apply",
"line_end": 590,
"line_start": 590
},
{
"call": "_write_alias",
"file_path": "src/app/ledger.py",
"function_name": "apply",
"line_end": 591,
"line_start": 591
}
],
"affected_locations_total": 3,
"api": null,
"evidence_truncated": false,
"intervention_symbol": "src/app/ledger.py::apply",
"judgment_steps": 3,
"mechanical_steps": 0,
"opportunity_id": "perf3_2719b6813419ad35948b",
"paths": [
[
"src/app/ledger.py::apply",
"src/app/ledger.py::_move"
],
[
"src/app/ledger.py::apply",
"src/app/ledger.py::_fold_one"
],
[
"src/app/ledger.py::apply",
"src/app/ledger.py::_write_alias"
]
],
"paths_total": 3,
"safety": "advisory",
"steps": [
{
"action": "Collect the keys before the loop and replace the per-key _move database call with one batched call",
"applicability": "judgment",
"file_path": "src/app/ledger.py",
"line": 587,
"order": 1,
"symbol": "apply"
},
{
"action": "Collect the keys before the loop and replace the per-key _fold_one database call with one batched call",
"applicability": "judgment",
"file_path": "src/app/ledger.py",
"line": 590,
"order": 2,
"symbol": "apply"
},
{
"action": "Collect the keys before the loop and replace the per-key _write_alias database call with one batched call",
"applicability": "judgment",
"file_path": "src/app/ledger.py",
"line": 591,
"order": 3,
"symbol": "apply"
}
],
"strategy": "batch_or_prefetch_io"
},
"refactoring_type": "performance_fix",
"source_biomarker": "io_in_loop",
"target_symbol": "src/app/ledger.py::apply"
},
{
"blast_radius": {
"call_sites": 2,
"file_count": 1,
"files": [
"src/app/entry.py"
]
},
"confidence": "medium",
"evidence": {
"affected_files_total": 1,
"biomarker_type": "io_in_loop",
"biomarker_types": [
"io_in_loop"
],
"boundary_kind": "db",
"execution_context": "production",
"observations_total": 2,
"provenance": "call-site",
"rank_factors": {
"affected_call_sites": 3,
"boundary_kind": 4,
"execution_context": 3,
"execution_role": 1,
"loop_magnitude": 0,
"multiplier_shape": 4,
"provenance": 3
},
"rank_score": 18,
"rationale": "The shared I/O sink is proven; no concrete batch API or result-equivalence proof is available.",
"reliable_entry_reachability": true
},
"file_path": "src/app/entry.py",
"impact_delta": 0.0,
"line_end": 252,
"line_start": 250,
"plan": {
"affected_locations": [
{
"call": "_hit",
"file_path": "src/app/entry.py",
"function_name": "a",
"line_end": 252,
"line_start": 250
},
{
"call": "_hit",
"file_path": "src/app/entry.py",
"function_name": "b",
"line_end": 257,
"line_start": 255
}
],
"affected_locations_total": 2,
"api": null,
"evidence_truncated": false,
"intervention_symbol": "src/app/entry.py::_hit",
"judgment_steps": 3,
"mechanical_steps": 0,
"opportunity_id": "perf3_6690af4c5e3f269c266e",
"paths": [
[
"src/app/entry.py::a",
"src/app/entry.py::_hit",
"src/app/db.py::reach_sink"
],
[
"src/app/entry.py::b",
"src/app/entry.py::_hit",
"src/app/db.py::reach_sink"
]
],
"paths_total": 2,
"safety": "advisory",
"steps": [
{
"action": "Add a form of _hit that takes every key at once",
"applicability": "judgment",
"file_path": "src/app/entry.py",
"line": null,
"order": 1,
"symbol": "src/app/entry.py::_hit"
},
{
"action": "Collect the keys before the loop and replace the per-key _hit database call with one batched call",
"applicability": "judgment",
"file_path": "src/app/entry.py",
"line": 250,
"order": 2,
"symbol": "a"
},
{
"action": "Collect the keys before the loop and replace the per-key _hit database call with one batched call",
"applicability": "judgment",
"file_path": "src/app/entry.py",
"line": 255,
"order": 3,
"symbol": "b"
}
],
"strategy": "batch_or_prefetch_io"
},
"refactoring_type": "performance_fix",
"source_biomarker": "io_in_loop",
"target_symbol": "src/app/entry.py::_hit"
},
{
"blast_radius": {
"call_sites": 2,
"file_count": 1,
"files": [
"src/app/api.py"
]
},
"confidence": "medium",
"evidence": {
"affected_files_total": 1,
"biomarker_type": "io_in_loop",
"biomarker_types": [
"io_in_loop"
],
"boundary_kind": "db",
"execution_context": "production",
"observations_total": 2,
"provenance": "call-site",
"rank_factors": {
"affected_call_sites": 3,
"boundary_kind": 4,
"execution_context": 3,
"execution_role": 1,
"loop_magnitude": 0,
"multiplier_shape": 4,
"provenance": 3
},
"rank_score": 18,
"rationale": "The shared I/O sink is proven; no concrete batch API or result-equivalence proof is available.",
"reliable_entry_reachability": true
},
"file_path": "src/app/repo.py",
"impact_delta": 0.0,
"line_end": null,
"line_start": null,
"plan": {
"affected_locations": [
{
"call": "fetch_page",
"file_path": "src/app/api.py",
"function_name": "list_users",
"line_end": 32,
"line_start": 30
},
{
"call": "fetch_page",
"file_path": "src/app/api.py",
"function_name": "list_orders",
"line_end": 33,
"line_start": 31
}
],
"affected_locations_total": 2,
"api": null,
"evidence_truncated": false,
"intervention_symbol": "src/app/repo.py::fetch_page",
"judgment_steps": 3,
"mechanical_steps": 0,
"opportunity_id": "perf3_8456a319d03ac90c6041",
"paths": [
[
"src/app/api.py::list_users",
"src/app/repo.py::fetch_page",
"src/app/db.py::execute"
],
[
"src/app/api.py::list_orders",
"src/app/repo.py::fetch_page",
"src/app/db.py::execute"
]
],
"paths_total": 2,
"safety": "advisory",
"steps": [
{
"action": "Add a form of fetch_page that takes every key at once",
"applicability": "judgment",
"file_path": "src/app/repo.py",
"line": null,
"order": 1,
"symbol": "src/app/repo.py::fetch_page"
},
{
"action": "Collect the keys before the loop and replace the per-key fetch_page database call with one batched call",
"applicability": "judgment",
"file_path": "src/app/api.py",
"line": 30,
"order": 2,
"symbol": "list_users"
},
{
"action": "Collect the keys before the loop and replace the per-key fetch_page database call with one batched call",
"applicability": "judgment",
"file_path": "src/app/api.py",
"line": 31,
"order": 3,
"symbol": "list_orders"
}
],
"strategy": "batch_or_prefetch_io"
},
"refactoring_type": "performance_fix",
"source_biomarker": "io_in_loop",
"target_symbol": "src/app/repo.py::fetch_page"
},
{
"blast_radius": {
"call_sites": 2,
"file_count": 1,
"files": [
"src/app/sync.py"
]
},
"confidence": "medium",
"evidence": {
"affected_files_total": 1,
"biomarker_type": "io_in_loop",
"biomarker_types": [
"io_in_loop"
],
"boundary_kind": "db",
"execution_context": "production",
"observations_total": 2,
"provenance": "call-site",
"rank_factors": {
"affected_call_sites": 3,
"boundary_kind": 4,
"execution_context": 3,
"execution_role": 1,
"loop_magnitude": 0,
"multiplier_shape": 4,
"provenance": 3
},
"rank_score": 18,
"rationale": "The shared I/O sink is proven; no concrete batch API or result-equivalence proof is available.",
"reliable_entry_reachability": null
},
"file_path": "src/app/sync.py",
"impact_delta": 0.0,
"line_end": 72,
"line_start": 70,
"plan": {
"affected_locations": [
{
"call": "_load",
"file_path": "src/app/sync.py",
"function_name": "sync_one",
"line_end": 72,
"line_start": 70
},
{
"call": "_load",
"file_path": "src/app/sync.py",
"function_name": "sync_all",
"line_end": 73,
"line_start": 71
}
],
"affected_locations_total": 2,
"api": null,
"evidence_truncated": false,
"intervention_symbol": "src/app/sync.py::_load",
"judgment_steps": 3,
"mechanical_steps": 0,
"opportunity_id": "perf3_8845956c083937dad1ec",
"paths": [
[
"src/app/sync.py::sync_one",
"src/app/sync.py::_load",
"src/app/db.py::query"
],
[
"src/app/sync.py::sync_all",
"src/app/sync.py::_load",
"src/app/db.py::query"
]
],
"paths_total": 2,
"safety": "advisory",
"steps": [
{
"action": "Add a form of _load that takes every key at once",
"applicability": "judgment",
"file_path": "src/app/sync.py",
"line": null,
"order": 1,
"symbol": "src/app/sync.py::_load"
},
{
"action": "Collect the keys before the loop and replace the per-key _load database call with one batched call",
"applicability": "judgment",
"file_path": "src/app/sync.py",
"line": 70,
"order": 2,
"symbol": "sync_one"
},
{
"action": "Collect the keys before the loop and replace the per-key _load database call with one batched call",
"applicability": "judgment",
"file_path": "src/app/sync.py",
"line": 71,
"order": 3,
"symbol": "sync_all"
}
],
"strategy": "batch_or_prefetch_io"
},
"refactoring_type": "performance_fix",
"source_biomarker": "io_in_loop",
"target_symbol": "src/app/sync.py::_load"
},
{
"blast_radius": {
"call_sites": 1,
"file_count": 1,
"files": [
"src/app/cache.py"
]
},
"confidence": "medium",
"evidence": {
"affected_files_total": 1,
"biomarker_type": "blocking_io_under_lock",
"biomarker_types": [
"blocking_io_under_lock"
],
"boundary_kind": "db",
"execution_context": "production",
"observations_total": 1,
"provenance": "call-site",
"rank_factors": {
"affected_call_sites": 2,
"boundary_kind": 4,
"execution_context": 3,
"execution_role": 1,
"loop_magnitude": 0,
"multiplier_shape": 5,
"provenance": 3
},
"rank_score": 18,
"rationale": "I/O under the lock is proven, but shared-state ordering must be validated before moving it.",
"reliable_entry_reachability": null
},
"file_path": "src/app/cache.py",
"impact_delta": 0.0,
"line_end": 112,
"line_start": 110,
"plan": {
"affected_locations": [
{
"call": "write",
"file_path": "src/app/cache.py",
"function_name": "refresh",
"line_end": 112,
"line_start": 110
}
],
"affected_locations_total": 1,
"api": null,
"evidence_truncated": false,
"intervention_symbol": "src/app/cache.py::refresh",
"judgment_steps": 1,
"mechanical_steps": 0,
"opportunity_id": "perf3_600194da489eff07f26a",
"paths": [
[
"src/app/cache.py::refresh",
"src/app/db.py::write"
]
],
"paths_total": 1,
"safety": "advisory",
"steps": [
{
"action": "Move the I/O in refresh out of the locked section",
"applicability": "judgment",
"file_path": "src/app/cache.py",
"line": null,
"order": 1,
"symbol": "src/app/cache.py::refresh"
}
],
"strategy": "shrink_lock_scope"
},
"refactoring_type": "performance_fix",
"source_biomarker": "blocking_io_under_lock",
"target_symbol": "src/app/cache.py::refresh"
},
{
"blast_radius": {
"call_sites": 1,
"file_count": 1,
"files": [
"src/app/fetch.py"
]
},
"confidence": "high",
"evidence": {
"affected_files_total": 1,
"biomarker_type": "serial_await_in_loop",
"biomarker_types": [
"serial_await_in_loop"
],
"boundary_kind": "network",
"execution_context": "production",
"observations_total": 1,
"provenance": "direct",
"rank_factors": {
"affected_call_sites": 2,
"boundary_kind": 4,
"execution_context": 3,
"execution_role": 1,
"loop_magnitude": 0,
"multiplier_shape": 4,
"provenance": 3
},
"rank_score": 17,
"rationale": "Iterations are independent and each await already runs under self._sem.",
"reliable_entry_reachability": null
},
"file_path": "src/app/fetch.py",
"impact_delta": 0.0,
"line_end": 42,
"line_start": 40,
"plan": {
"affected_locations": [
{
"file_path": "src/app/fetch.py",
"function_name": "fetch_each",
"line_end": 42,
"line_start": 40
}
],
"affected_locations_total": 1,
"api": "self._sem",
"evidence_truncated": false,
"intervention_symbol": "src/app/fetch.py::fetch_each",
"judgment_steps": 0,
"mechanical_steps": 1,
"opportunity_id": "perf3_877f87ea6dac79fd92fc",
"paths": [],
"paths_total": 1,
"safety": "proven",
"steps": [
{
"action": "Run the independent network calls concurrently, each still inside self._sem",
"applicability": "mechanical",
"file_path": "src/app/fetch.py",
"line": 40,
"order": 1,
"symbol": "fetch_each"
}
],
"strategy": "parallelize_independent_awaits"
},
"refactoring_type": "performance_fix",
"source_biomarker": "serial_await_in_loop",
"target_symbol": "src/app/fetch.py::fetch_each"
},
{
"blast_radius": {
"call_sites": 1,
"file_count": 1,
"files": [
"src/app/commits.py"
]
},
"confidence": "medium",
"evidence": {
"affected_files_total": 1,
"biomarker_type": "io_in_loop",
"biomarker_types": [
"io_in_loop"
],
"boundary_kind": "db",
"execution_context": "production",
"observations_total": 1,
"provenance": "direct",
"rank_factors": {
"affected_call_sites": 2,
"boundary_kind": 4,
"execution_context": 3,
"execution_role": 1,
"loop_magnitude": 0,
"multiplier_shape": 4,
"provenance": 3
},
"rank_score": 17,
"rationale": "Every call filters on the loop's own key, so .in_(\"repo_id\", keys) is the bulk form; the per-key call limits, orders or shares the loop with other I/O.",
"reliable_entry_reachability": null
},
"file_path": "src/app/commits.py",
"impact_delta": 0.0,
"line_end": 32,
"line_start": 30,
"plan": {
"affected_locations": [
{
"file_path": "src/app/commits.py",
"function_name": "first_commit_each",
"line_end": 32,
"line_start": 30
}
],
"affected_locations_total": 1,
"api": ".in_(\"repo_id\", keys)",
"evidence_truncated": false,
"intervention_symbol": "src/app/commits.py::first_commit_each",
"judgment_steps": 1,
"mechanical_steps": 0,
"opportunity_id": "perf3_2a6f52da25a5ede16116",
"paths": [],
"paths_total": 1,
"safety": "advisory",
"steps": [
{
"action": "Collect the keys before the loop and make one call with .in_(\"repo_id\", keys) in place of the per-key database call",
"applicability": "judgment",
"file_path": "src/app/commits.py",
"line": 30,
"order": 1,
"symbol": "first_commit_each"
}
],
"strategy": "batch_or_prefetch_io"
},
"refactoring_type": "performance_fix",
"source_biomarker": "io_in_loop",
"target_symbol": "src/app/commits.py::first_commit_each"
},
{
"blast_radius": {
"call_sites": 1,
"file_count": 1,
"files": [
"src/app/fanout.py"
]
},
"confidence": "medium",
"evidence": {
"affected_files_total": 1,
"biomarker_type": "serial_await_in_loop",
"biomarker_types": [
"serial_await_in_loop"
],
"boundary_kind": "network",
"execution_context": "production",
"observations_total": 1,
"provenance": "direct",
"rank_factors": {
"affected_call_sites": 2,
"boundary_kind": 4,
"execution_context": 3,
"execution_role": 1,
"loop_magnitude": 0,
"multiplier_shape": 4,
"provenance": 3
},
"rank_score": 17,
"rationale": "Iteration independence is proven; the concurrency the fan-out would create is not bounded by anything this group can see.",
"reliable_entry_reachability": null
},
"file_path": "src/app/fanout.py",
"impact_delta": 0.0,
"line_end": 92,
"line_start": 90,
"plan": {
"affected_locations": [
{
"file_path": "src/app/fanout.py",
"function_name": "gather_all",
"line_end": 92,
"line_start": 90
}
],
"affected_locations_total": 1,
"api": null,
"evidence_truncated": false,
"intervention_symbol": "src/app/fanout.py::gather_all",
"judgment_steps": 1,
"mechanical_steps": 0,
"opportunity_id": "perf3_445b62193f1ff0db3cb4",
"paths": [],
"paths_total": 1,
"safety": "advisory",
"steps": [
{
"action": "Run the independent network calls concurrently, with a bound on how many at once",
"applicability": "judgment",
"file_path": "src/app/fanout.py",
"line": 90,
"order": 1,
"symbol": "gather_all"
}
],
"strategy": "parallelize_independent_awaits"
},
"refactoring_type": "performance_fix",
"source_biomarker": "serial_await_in_loop",
"target_symbol": "src/app/fanout.py::gather_all"
},
{
"blast_radius": {
"call_sites": 1,
"file_count": 1,
"files": [
"src/app/job.py"
]
},
"confidence": "medium",
"evidence": {
"affected_files_total": 1,
"biomarker_type": "io_in_loop",
"biomarker_types": [
"io_in_loop"
],
"boundary_kind": "db",
"execution_context": "production",
"observations_total": 1,
"provenance": "call-site",
"rank_factors": {
"affected_call_sites": 2,
"boundary_kind": 4,
"execution_context": 3,
"execution_role": 1,
"loop_magnitude": 0,
"multiplier_shape": 4,
"provenance": 3
},
"rank_score": 17,
"rationale": "The shared I/O sink is proven; no concrete batch API or result-equivalence proof is available.",
"reliable_entry_reachability": null
},
"file_path": "src/app/job.py",
"impact_delta": 0.0,
"line_end": 202,
"line_start": 200,
"plan": {
"affected_locations": [
{
"call": "get_session",
"file_path": "src/app/job.py",
"function_name": "run",
"line_end": 202,
"line_start": 200
}
],
"affected_locations_total": 1,
"api": null,
"evidence_truncated": false,
"intervention_symbol": "src/app/job.py::run",
"judgment_steps": 2,
"mechanical_steps": 0,
"opportunity_id": "perf3_4e3feb071c73aa51a6a4",
"paths": [
[
"src/app/job.py::run",
"src/app/db.py::get_session"
]
],
"paths_total": 1,
"safety": "advisory",
"steps": [
{
"action": "Add a form of get_session that takes every key at once",
"applicability": "judgment",
"file_path": "src/app/db.py",
"line": null,
"order": 1,
"symbol": "src/app/db.py::get_session"
},
{
"action": "Collect the keys before the loop and replace the per-key get_session database call with one batched call",
"applicability": "judgment",
"file_path": "src/app/job.py",
"line": 200,
"order": 2,
"symbol": "run"
}
],
"strategy": "batch_or_prefetch_io"
},
"refactoring_type": "performance_fix",
"source_biomarker": "io_in_loop",
"target_symbol": "src/app/job.py::run"
},
{
"blast_radius": {
"call_sites": 1,
"file_count": 1,
"files": [
"src/app/lone.py"
]
},
"confidence": "medium",
"evidence": {
"affected_files_total": 1,
"biomarker_type": "io_in_loop",
"biomarker_types": [
"io_in_loop"
],
"boundary_kind": "db",
"execution_context": "production",
"observations_total": 1,
"provenance": "call-site",
"rank_factors": {
"affected_call_sites": 2,
"boundary_kind": 4,
"execution_context": 3,
"execution_role": 1,
"loop_magnitude": 0,
"multiplier_shape": 4,
"provenance": 3
},
"rank_score": 17,
"rationale": "The shared I/O sink is proven; no concrete batch API or result-equivalence proof is available.",
"reliable_entry_reachability": null
},
"file_path": "src/app/lone.py",
"impact_delta": 0.0,
"line_end": 11,
"line_start": 9,
"plan": {
"affected_locations": [
{
"file_path": "src/app/lone.py",
"function_name": "run",
"line_end": 11,
"line_start": 9
}
],
"affected_locations_total": 1,
"api": null,
"evidence_truncated": false,
"intervention_symbol": "src/app/lone.py::run",
"judgment_steps": 2,
"mechanical_steps": 0,
"opportunity_id": "perf3_919d91fe15e89966b389",
"paths": [
[
"src/app/db.py::only_sink"
]
],
"paths_total": 1,
"safety": "advisory",
"steps": [
{
"action": "Add a form of only_sink that takes every key at once",
"applicability": "judgment",
"file_path": "src/app/db.py",
"line": null,
"order": 1,
"symbol": "src/app/db.py::only_sink"
},
{
"action": "Collect the keys before the loop and replace the per-key database call with one batched call",
"applicability": "judgment",
"file_path": "src/app/lone.py",
"line": 9,
"order": 2,
"symbol": "run"
}
],
"strategy": "batch_or_prefetch_io"
},
"refactoring_type": "performance_fix",
"source_biomarker": "io_in_loop",
"target_symbol": "src/app/lone.py::run"
},
{
"blast_radius": {
"call_sites": 1,
"file_count": 1,
"files": [
"app/incidents/service.py"
]
},
"confidence": "medium",
"evidence": {
"affected_files_total": 1,
"biomarker_type": "lazy_load_in_loop",
"biomarker_types": [
"lazy_load_in_loop"
],
"boundary_kind": "db",
"execution_context": "production",
"observations_total": 1,
"provenance": "direct",
"rank_factors": {
"affected_call_sites": 2,
"boundary_kind": 4,
"execution_context": 3,
"execution_role": 1,
"loop_magnitude": 0,
"multiplier_shape": 4,
"provenance": 3
},
"rank_score": 17,
"rationale": "The relationship is declared lazy and the query that produced the rows does not load it; whether every iteration reaches the access, and whether another layer loads it first, is not proven.",
"reliable_entry_reachability": null
},
"file_path": "app/incidents/service.py",
"impact_delta": 0.0,
"line_end": 50,
"line_start": 50,
"plan": {
"affected_locations": [
{
"file_path": "app/incidents/service.py",
"function_name": "notify_owners",
"line_end": 50,
"line_start": 50
}
],
"affected_locations_total": 1,
"api": null,
"evidence_truncated": false,
"intervention_symbol": "app/incidents/service.py::notify_owners",
"judgment_steps": 0,
"mechanical_steps": 0,
"opportunity_id": "perf3_93a53323a7db0544017f",
"paths": [],
"paths_total": 1,
"safety": "advisory",
"steps": [],
"strategy": "eager_load_relationship"
},
"refactoring_type": "performance_fix",
"source_biomarker": "lazy_load_in_loop",
"target_symbol": "app/incidents/service.py::notify_owners"
},
{
"blast_radius": {
"call_sites": 1,
"file_count": 1,
"files": [
"app/issues/views.py"
]
},
"confidence": "medium",
"evidence": {
"affected_files_total": 1,
"biomarker_type": "lazy_load_in_loop",
"biomarker_types": [
"lazy_load_in_loop"
],
"boundary_kind": "db",
"execution_context": "production",
"observations_total": 1,
"provenance": "direct",
"rank_factors": {
"affected_call_sites": 2,
"boundary_kind": 4,
"execution_context": 3,
"execution_role": 1,
"loop_magnitude": 0,
"multiplier_shape": 4,
"provenance": 3
},
"rank_score": 17,
"rationale": "The relationship is declared lazy and the query that produced the rows does not load it; whether every iteration reaches the access, and whether another layer loads it first, is not proven.",
"reliable_entry_reachability": null
},
"file_path": "app/issues/views.py",
"impact_delta": 0.0,
"line_end": 30,
"line_start": 30,
"plan": {
"affected_locations": [
{
"file_path": "app/issues/views.py",
"function_name": "issue_list",
"line_end": 30,
"line_start": 30
}
],
"affected_locations_total": 1,
"api": null,
"evidence_truncated": false,
"intervention_symbol": "app/issues/views.py::issue_list",
"judgment_steps": 0,
"mechanical_steps": 0,
"opportunity_id": "perf3_942cceadc50a644175e4",
"paths": [],
"paths_total": 1,
"safety": "advisory",
"steps": [],
"strategy": "eager_load_relationship"
},
"refactoring_type": "performance_fix",
"source_biomarker": "lazy_load_in_loop",
"target_symbol": "app/issues/views.py::issue_list"
},
{
"blast_radius": {
"call_sites": 1,
"file_count": 1,
"files": [
"src/app/orders.py"
]
},
"confidence": "medium",
"evidence": {
"affected_files_total": 1,
"biomarker_type": "io_in_loop",
"biomarker_types": [
"io_in_loop"
],
"boundary_kind": "db",
"execution_context": "production",
"observations_total": 1,
"provenance": "call-site",
"rank_factors": {
"affected_call_sites": 2,
"boundary_kind": 4,
"execution_context": 3,
"execution_role": 1,
"loop_magnitude": 0,
"multiplier_shape": 4,
"provenance": 3
},
"rank_score": 17,
"rationale": "The shared I/O sink is proven; no concrete batch API or result-equivalence proof is available.",
"reliable_entry_reachability": false
},
"file_path": "src/app/orders.py",
"impact_delta": 0.0,
"line_end": 12,
"line_start": 10,
"plan": {
"affected_locations": [
{
"call": "get_session",
"file_path": "src/app/orders.py",
"function_name": "handle",
"line_end": 12,
"line_start": 10
}
],
"affected_locations_total": 1,
"api": null,
"evidence_truncated": false,
"intervention_symbol": "src/app/orders.py::handle",
"judgment_steps": 2,
"mechanical_steps": 0,
"opportunity_id": "perf3_95567b0824b33141361d",
"paths": [
[
"src/app/orders.py::handle",
"src/app/db.py::get_session"
]
],
"paths_total": 1,
"safety": "advisory",
"steps": [
{
"action": "Add a form of get_session that takes every key at once",
"applicability": "judgment",
"file_path": "src/app/db.py",
"line": null,
"order": 1,
"symbol": "src/app/db.py::get_session"
},
{
"action": "Collect the keys before the loop and replace the per-key get_session database call with one batched call",
"applicability": "judgment",
"file_path": "src/app/orders.py",
"line": 10,
"order": 2,
"symbol": "handle"
}
],
"strategy": "batch_or_prefetch_io"
},
"refactoring_type": "performance_fix",
"source_biomarker": "io_in_loop",
"target_symbol": "src/app/orders.py::handle"
},
{
"blast_radius": {
"call_sites": 1,
"file_count": 1,
"files": [
"src/app/reports.py"
]
},
"confidence": "medium",
"evidence": {
"affected_files_total": 1,
"biomarker_type": "io_in_loop",
"biomarker_types": [
"io_in_loop"
],
"boundary_kind": "db",
"execution_context": "production",
"observations_total": 1,
"provenance": "call-site",
"rank_factors": {
"affected_call_sites": 2,
"boundary_kind": 4,
"execution_context": 3,
"execution_role": 1,
"loop_magnitude": 0,
"multiplier_shape": 4,
"provenance": 3
},
"rank_score": 17,
"rationale": "The shared I/O sink is proven; no concrete batch API or result-equivalence proof is available.",
"reliable_entry_reachability": false
},
"file_path": "src/app/reports.py",
"impact_delta": 0.0,
"line_end": 14,
"line_start": 12,
"plan": {
"affected_locations": [
{
"call": "get_session",
"file_path": "src/app/reports.py",
"function_name": "handle",
"line_end": 14,
"line_start": 12
}
],
"affected_locations_total": 1,
"api": null,
"evidence_truncated": false,
"intervention_symbol": "src/app/reports.py::handle",
"judgment_steps": 2,
"mechanical_steps": 0,
"opportunity_id": "perf3_a0ebb8db3cb33a2c555f",
"paths": [
[
"src/app/reports.py::handle",
"src/app/db.py::get_session"
]
],
"paths_total": 1,
"safety": "advisory",
"steps": [
{
"action": "Add a form of get_session that takes every key at once",
"applicability": "judgment",
"file_path": "src/app/db.py",
"line": null,
"order": 1,
"symbol": "src/app/db.py::get_session"
},
{
"action": "Collect the keys before the loop and replace the per-key get_session database call with one batched call",
"applicability": "judgment",
"file_path": "src/app/reports.py",
"line": 12,
"order": 2,
"symbol": "handle"
}
],
"strategy": "batch_or_prefetch_io"
},
"refactoring_type": "performance_fix",
"source_biomarker": "io_in_loop",
"target_symbol": "src/app/reports.py::handle"
},
{
"blast_radius": {
"call_sites": 1,
"file_count": 1,
"files": [
"src/app/billing.py"
]
},
"confidence": "medium",
"evidence": {
"affected_files_total": 1,
"biomarker_type": "io_in_loop",
"biomarker_types": [
"io_in_loop"
],
"boundary_kind": "db",
"execution_context": "production",
"observations_total": 1,
"provenance": "call-site",
"rank_factors": {
"affected_call_sites": 2,
"boundary_kind": 4,
"execution_context": 3,
"execution_role": 1,
"loop_magnitude": 0,
"multiplier_shape": 4,
"provenance": 3
},
"rank_score": 17,
"rationale": "The shared I/O sink is proven; no concrete batch API or result-equivalence proof is available.",
"reliable_entry_reachability": false
},
"file_path": "src/app/billing.py",
"impact_delta": 0.0,
"line_end": 13,
"line_start": 11,
"plan": {
"affected_locations": [
{
"call": "get_session",
"file_path": "src/app/billing.py",
"function_name": "handle",
"line_end": 13,
"line_start": 11
}
],
"affected_locations_total": 1,
"api": null,
"evidence_truncated": false,
"intervention_symbol": "src/app/billing.py::handle",
"judgment_steps": 2,
"mechanical_steps": 0,
"opportunity_id": "perf3_debc1e358c095e5fd0d8",
"paths": [
[
"src/app/billing.py::handle",
"src/app/db.py::get_session"
]
],
"paths_total": 1,
"safety": "advisory",
"steps": [
{
"action": "Add a form of get_session that takes every key at once",
"applicability": "judgment",
"file_path": "src/app/db.py",
"line": null,
"order": 1,
"symbol": "src/app/db.py::get_session"
},
{
"action": "Collect the keys before the loop and replace the per-key get_session database call with one batched call",
"applicability": "judgment",
"file_path": "src/app/billing.py",
"line": 11,
"order": 2,
"symbol": "handle"
}
],
"strategy": "batch_or_prefetch_io"
},
"refactoring_type": "performance_fix",
"source_biomarker": "io_in_loop",
"target_symbol": "src/app/billing.py::handle"
},
{
"blast_radius": {
"call_sites": 1,
"file_count": 1,
"files": [
"scripts/backfill.py"
]
},
"confidence": "medium",
"evidence": {
"affected_files_total": 1,
"biomarker_type": "io_in_loop",
"biomarker_types": [
"io_in_loop"
],
"boundary_kind": "db",
"execution_context": "tooling",
"observations_total": 1,
"provenance": "call-site",
"rank_factors": {
"affected_call_sites": 2,
"boundary_kind": 4,
"execution_context": 2,
"execution_role": 1,
"loop_magnitude": 0,
"multiplier_shape": 4,
"provenance": 3
},
"rank_score": 16,
"rationale": "The shared I/O sink is proven; no concrete batch API or result-equivalence proof is available.",
"reliable_entry_reachability": null
},
"file_path": "scripts/backfill.py",
"impact_delta": 0.0,
"line_end": 202,
"line_start": 200,
"plan": {
"affected_locations": [
{
"call": "get_session",
"file_path": "scripts/backfill.py",
"function_name": "run",
"line_end": 202,
"line_start": 200
}
],
"affected_locations_total": 1,
"api": null,
"evidence_truncated": false,
"intervention_symbol": "scripts/backfill.py::run",
"judgment_steps": 2,
"mechanical_steps": 0,
"opportunity_id": "perf3_d5225971c0220c77ee7b",
"paths": [
[
"scripts/backfill.py::run",
"src/app/db.py::get_session"
]
],
"paths_total": 1,
"safety": "advisory",
"steps": [
{
"action": "Add a form of get_session that takes every key at once",
"applicability": "judgment",
"file_path": "src/app/db.py",
"line": null,
"order": 1,
"symbol": "src/app/db.py::get_session"
},
{
"action": "Collect the keys before the loop and replace the per-key get_session database call with one batched call",
"applicability": "judgment",
"file_path": "scripts/backfill.py",
"line": 200,
"order": 2,
"symbol": "run"
}
],
"strategy": "batch_or_prefetch_io"
},
"refactoring_type": "performance_fix",
"source_biomarker": "io_in_loop",
"target_symbol": "scripts/backfill.py::run"
},
{
"blast_radius": {
"call_sites": 1,
"file_count": 1,
"files": [
"src/app/edge.py"
]
},
"confidence": "medium",
"evidence": {
"affected_files_total": 1,
"biomarker_type": "io_in_loop",
"biomarker_types": [
"io_in_loop"
],
"boundary_kind": "db",
"execution_context": "production",
"observations_total": 1,
"provenance": "reliable-edge",
"rank_factors": {
"affected_call_sites": 2,
"boundary_kind": 4,
"execution_context": 3,
"execution_role": 1,
"loop_magnitude": 0,
"multiplier_shape": 4,
"provenance": 2
},
"rank_score": 16,
"rationale": "The shared I/O sink is proven; no concrete batch API or result-equivalence proof is available.",
"reliable_entry_reachability": null
},
"file_path": "src/app/edge.py",
"impact_delta": 0.0,
"line_end": 232,
"line_start": 230,
"plan": {
"affected_locations": [
{
"call": "reliable_sink",
"file_path": "src/app/edge.py",
"function_name": "run",
"line_end": 232,
"line_start": 230
}
],
"affected_locations_total": 1,
"api": null,
"evidence_truncated": false,
"intervention_symbol": "src/app/edge.py::run",
"judgment_steps": 2,
"mechanical_steps": 0,
"opportunity_id": "perf3_dc2d9734ec9693504602",
"paths": [
[
"src/app/edge.py::run",
"src/app/db.py::reliable_sink"
]
],
"paths_total": 1,
"safety": "advisory",
"steps": [
{
"action": "Add a form of reliable_sink that takes every key at once",
"applicability": "judgment",
"file_path": "src/app/db.py",
"line": null,
"order": 1,
"symbol": "src/app/db.py::reliable_sink"
},
{
"action": "Collect the keys before the loop and replace the per-key reliable_sink database call with one batched call",
"applicability": "judgment",
"file_path": "src/app/edge.py",
"line": 230,
"order": 2,
"symbol": "run"
}
],
"strategy": "batch_or_prefetch_io"
},
"refactoring_type": "performance_fix",
"source_biomarker": "io_in_loop",
"target_symbol": "src/app/edge.py::run"
},
{
"blast_radius": {
"call_sites": 1,
"file_count": 1,
"files": [
"src/app/guess.py"
]
},
"confidence": "medium",
"evidence": {
"affected_files_total": 1,
"biomarker_type": "io_in_loop",
"biomarker_types": [
"io_in_loop"
],
"boundary_kind": "db",
"execution_context": "production",
"observations_total": 1,
"provenance": "name-fallback",
"rank_factors": {
"affected_call_sites": 2,
"boundary_kind": 4,
"execution_context": 3,
"execution_role": 1,
"loop_magnitude": 0,
"multiplier_shape": 4,
"provenance": 0
},
"rank_score": 14,
"rationale": "The shared I/O sink is proven; no concrete batch API or result-equivalence proof is available.",
"reliable_entry_reachability": null
},
"file_path": "src/app/guess.py",
"impact_delta": 0.0,
"line_end": 242,
"line_start": 240,
"plan": {
"affected_locations": [
{
"call": "guessed_sink",
"file_path": "src/app/guess.py",
"function_name": "run",
"line_end": 242,
"line_start": 240
}
],
"affected_locations_total": 1,
"api": null,
"evidence_truncated": false,
"intervention_symbol": "src/app/guess.py::run",
"judgment_steps": 2,
"mechanical_steps": 0,
"opportunity_id": "perf3_b4b1621506e7231c520b",
"paths": [
[
"src/app/guess.py::run",
"src/app/db.py::guessed_sink"
]
],
"paths_total": 1,
"safety": "advisory",
"steps": [
{
"action": "Add a form of guessed_sink that takes every key at once",
"applicability": "judgment",
"file_path": "src/app/db.py",
"line": null,
"order": 1,
"symbol": "src/app/db.py::guessed_sink"
},
{
"action": "Collect the keys before the loop and replace the per-key guessed_sink database call with one batched call",
"applicability": "judgment",
"file_path": "src/app/guess.py",
"line": 240,
"order": 2,
"symbol": "run"
}
],
"strategy": "batch_or_prefetch_io"
},
"refactoring_type": "performance_fix",
"source_biomarker": "io_in_loop",
"target_symbol": "src/app/guess.py::run"
},
{
"blast_radius": {
"call_sites": 1,
"file_count": 1,
"files": [
"src/app/filters.py"
]
},
"confidence": "medium",
"evidence": {
"affected_files_total": 1,
"biomarker_type": "membership_test_against_list_in_loop",
"biomarker_types": [
"membership_test_against_list_in_loop"
],
"boundary_kind": null,
"execution_context": "production",
"observations_total": 1,
"provenance": "direct",
"rank_factors": {
"affected_call_sites": 2,
"boundary_kind": 0,
"execution_context": 3,
"execution_role": 1,
"loop_magnitude": 0,
"multiplier_shape": 3,
"provenance": 3
},
"rank_score": 12,
"rationale": "The collection is proven list-backed; element hashability and ordering/identity use still require validation.",
"reliable_entry_reachability": null
},
"file_path": "src/app/filters.py",
"impact_delta": 0.0,
"line_end": 152,
"line_start": 150,
"plan": {
"affected_locations": [
{
"file_path": "src/app/filters.py",
"function_name": "select",
"line_end": 152,
"line_start": 150
}
],
"affected_locations_total": 1,
"api": null,
"evidence_truncated": false,
"intervention_symbol": "src/app/filters.py::select",
"judgment_steps": 1,
"mechanical_steps": 0,
"opportunity_id": "perf3_68f6614ac285d1e8cb4a",
"paths": [],
"paths_total": 1,
"safety": "advisory",
"steps": [
{
"action": "Build a set once before the loop and probe it",
"applicability": "judgment",
"file_path": "src/app/filters.py",
"line": 150,
"order": 1,
"symbol": "select"
}
],
"strategy": "replace_membership_collection"
},
"refactoring_type": "performance_fix",
"source_biomarker": "membership_test_against_list_in_loop",
"target_symbol": "src/app/filters.py::select"
},
{
"blast_radius": {
"call_sites": 1,
"file_count": 1,
"files": [
"src/app/render.py"
]
},
"confidence": "medium",
"evidence": {
"affected_files_total": 1,
"biomarker_type": "string_concat_in_loop",
"biomarker_types": [
"string_concat_in_loop"
],
"boundary_kind": null,
"execution_context": "production",
"observations_total": 1,
"provenance": "direct",
"rank_factors": {
"affected_call_sites": 2,
"boundary_kind": 0,
"execution_context": 3,
"execution_role": 1,
"loop_magnitude": 0,
"multiplier_shape": 3,
"provenance": 3
},
"rank_score": 12,
"rationale": "Repeated string accumulation is proven; intermediate accumulator observations still require validation.",
"reliable_entry_reachability": null
},
"file_path": "src/app/render.py",
"impact_delta": 0.0,
"line_end": 162,
"line_start": 160,
"plan": {
"affected_locations": [
{
"file_path": "src/app/render.py",
"function_name": "to_csv",
"line_end": 162,
"line_start": 160
}
],
"affected_locations_total": 1,
"api": null,
"evidence_truncated": false,
"intervention_symbol": "src/app/render.py::to_csv",
"judgment_steps": 1,
"mechanical_steps": 0,
"opportunity_id": "perf3_ea095ac8d3d612777176",
"paths": [],
"paths_total": 1,
"safety": "advisory",
"steps": [
{
"action": "Accumulate into a list and join once after the loop",
"applicability": "judgment",
"file_path": "src/app/render.py",
"line": 160,
"order": 1,
"symbol": "to_csv"
}
],
"strategy": "buffer_string_accumulation"
},
"refactoring_type": "performance_fix",
"source_biomarker": "string_concat_in_loop",
"target_symbol": "src/app/render.py::to_csv"
}
]
}