blastradius-skill 1.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. blastradius_skill-1.0.1/.github/workflows/ci.yml +44 -0
  2. blastradius_skill-1.0.1/.github/workflows/publish.yml +53 -0
  3. blastradius_skill-1.0.1/.gitignore +40 -0
  4. blastradius_skill-1.0.1/.mcp.json +12 -0
  5. blastradius_skill-1.0.1/AGENTS.md +83 -0
  6. blastradius_skill-1.0.1/LICENSE +21 -0
  7. blastradius_skill-1.0.1/PKG-INFO +342 -0
  8. blastradius_skill-1.0.1/README.md +311 -0
  9. blastradius_skill-1.0.1/SKILL.md +37 -0
  10. blastradius_skill-1.0.1/benchmarks/eval_modes.py +466 -0
  11. blastradius_skill-1.0.1/benchmarks/fullstack_agent.py +258 -0
  12. blastradius_skill-1.0.1/benchmarks/repos.json +26 -0
  13. blastradius_skill-1.0.1/benchmarks/repos_ts.json +16 -0
  14. blastradius_skill-1.0.1/benchmarks/results/.gitkeep +0 -0
  15. blastradius_skill-1.0.1/benchmarks/results/fullstack_eval.json +385 -0
  16. blastradius_skill-1.0.1/benchmarks/results/git_replay_eval.json +290 -0
  17. blastradius_skill-1.0.1/benchmarks/results/static_eval.json +607 -0
  18. blastradius_skill-1.0.1/benchmarks/results/static_eval_ts.json +295 -0
  19. blastradius_skill-1.0.1/benchmarks/run.py +678 -0
  20. blastradius_skill-1.0.1/benchmarks/tasks/.gitkeep +0 -0
  21. blastradius_skill-1.0.1/benchmarks/tasks/git_replay_commits.json +15 -0
  22. blastradius_skill-1.0.1/benchmarks/tasks/tasks.json +386 -0
  23. blastradius_skill-1.0.1/benchmarks/tasks/tasks_fullstack.json +161 -0
  24. blastradius_skill-1.0.1/benchmarks/tasks/tasks_ts.json +162 -0
  25. blastradius_skill-1.0.1/evals/.gitkeep +0 -0
  26. blastradius_skill-1.0.1/evals/decorator-edit-require-auth/case.yaml +12 -0
  27. blastradius_skill-1.0.1/evals/decorator-edit-require-auth/graders/grade.py +31 -0
  28. blastradius_skill-1.0.1/evals/decorator-edit-require-auth/prompt.md +1 -0
  29. blastradius_skill-1.0.1/evals/modify-method-user-save/case.yaml +13 -0
  30. blastradius_skill-1.0.1/evals/modify-method-user-save/graders/grade.py +30 -0
  31. blastradius_skill-1.0.1/evals/modify-method-user-save/prompt.md +1 -0
  32. blastradius_skill-1.0.1/evals/rename-helper-hash-password/case.yaml +22 -0
  33. blastradius_skill-1.0.1/evals/rename-helper-hash-password/graders/grade.py +27 -0
  34. blastradius_skill-1.0.1/evals/rename-helper-hash-password/prompt.md +1 -0
  35. blastradius_skill-1.0.1/evals/run_evals.py +58 -0
  36. blastradius_skill-1.0.1/evals/signature-change-create-user/case.yaml +19 -0
  37. blastradius_skill-1.0.1/evals/signature-change-create-user/graders/grade.py +26 -0
  38. blastradius_skill-1.0.1/evals/signature-change-create-user/prompt.md +1 -0
  39. blastradius_skill-1.0.1/evals/trace-error-user-card/case.yaml +8 -0
  40. blastradius_skill-1.0.1/evals/trace-error-user-card/graders/grade.py +38 -0
  41. blastradius_skill-1.0.1/evals/trace-error-user-card/prompt.md +8 -0
  42. blastradius_skill-1.0.1/evals/trigger-evals/cases.json +35 -0
  43. blastradius_skill-1.0.1/evals/type-contract-user-init/case.yaml +17 -0
  44. blastradius_skill-1.0.1/evals/type-contract-user-init/graders/grade.py +29 -0
  45. blastradius_skill-1.0.1/evals/type-contract-user-init/prompt.md +1 -0
  46. blastradius_skill-1.0.1/plan.md +1032 -0
  47. blastradius_skill-1.0.1/pyproject.toml +76 -0
  48. blastradius_skill-1.0.1/references/limitations.md +18 -0
  49. blastradius_skill-1.0.1/references/output-schema.md +211 -0
  50. blastradius_skill-1.0.1/scripts/install_check.py +211 -0
  51. blastradius_skill-1.0.1/src/blastradius/__init__.py +3 -0
  52. blastradius_skill-1.0.1/src/blastradius/architecture.py +537 -0
  53. blastradius_skill-1.0.1/src/blastradius/blast.py +828 -0
  54. blastradius_skill-1.0.1/src/blastradius/cache.py +552 -0
  55. blastradius_skill-1.0.1/src/blastradius/cli.py +397 -0
  56. blastradius_skill-1.0.1/src/blastradius/coverage_map.py +285 -0
  57. blastradius_skill-1.0.1/src/blastradius/coverage_parsers.py +297 -0
  58. blastradius_skill-1.0.1/src/blastradius/extractors/__init__.py +39 -0
  59. blastradius_skill-1.0.1/src/blastradius/extractors/blind_spots.py +252 -0
  60. blastradius_skill-1.0.1/src/blastradius/extractors/blind_spots_ts.py +174 -0
  61. blastradius_skill-1.0.1/src/blastradius/extractors/fastapi_helpers.py +342 -0
  62. blastradius_skill-1.0.1/src/blastradius/extractors/fastapi_pydantic.py +334 -0
  63. blastradius_skill-1.0.1/src/blastradius/extractors/fastapi_resolver.py +320 -0
  64. blastradius_skill-1.0.1/src/blastradius/extractors/models.py +274 -0
  65. blastradius_skill-1.0.1/src/blastradius/extractors/nextjs_helpers.py +334 -0
  66. blastradius_skill-1.0.1/src/blastradius/extractors/nextjs_react.py +309 -0
  67. blastradius_skill-1.0.1/src/blastradius/extractors/nextjs_resolver.py +354 -0
  68. blastradius_skill-1.0.1/src/blastradius/git_cochange.py +333 -0
  69. blastradius_skill-1.0.1/src/blastradius/graph.py +877 -0
  70. blastradius_skill-1.0.1/src/blastradius/hooks/__init__.py +1 -0
  71. blastradius_skill-1.0.1/src/blastradius/hooks/claude_pre_edit.py +176 -0
  72. blastradius_skill-1.0.1/src/blastradius/indexer.py +1295 -0
  73. blastradius_skill-1.0.1/src/blastradius/resolver.py +1166 -0
  74. blastradius_skill-1.0.1/src/blastradius/risk.py +271 -0
  75. blastradius_skill-1.0.1/src/blastradius/server.py +913 -0
  76. blastradius_skill-1.0.1/src/blastradius/trace_error.py +310 -0
  77. blastradius_skill-1.0.1/src/blastradius/ts_parser.py +1390 -0
  78. blastradius_skill-1.0.1/src/blastradius/verify.py +696 -0
  79. blastradius_skill-1.0.1/src/blastradius/verify_checks.py +299 -0
  80. blastradius_skill-1.0.1/src/blastradius/verify_typecheck.py +391 -0
  81. blastradius_skill-1.0.1/tests/__init__.py +0 -0
  82. blastradius_skill-1.0.1/tests/fixtures/expected_outputs.json +106 -0
  83. blastradius_skill-1.0.1/tests/fixtures/expected_outputs_ts.json +37 -0
  84. blastradius_skill-1.0.1/tests/fixtures/fullstack_rbac_repo/backend/app/__init__.py +1 -0
  85. blastradius_skill-1.0.1/tests/fixtures/fullstack_rbac_repo/backend/app/config.py +9 -0
  86. blastradius_skill-1.0.1/tests/fixtures/fullstack_rbac_repo/backend/app/db.py +31 -0
  87. blastradius_skill-1.0.1/tests/fixtures/fullstack_rbac_repo/backend/app/deps.py +37 -0
  88. blastradius_skill-1.0.1/tests/fixtures/fullstack_rbac_repo/backend/app/main.py +15 -0
  89. blastradius_skill-1.0.1/tests/fixtures/fullstack_rbac_repo/backend/app/models/__init__.py +1 -0
  90. blastradius_skill-1.0.1/tests/fixtures/fullstack_rbac_repo/backend/app/models/auth.py +28 -0
  91. blastradius_skill-1.0.1/tests/fixtures/fullstack_rbac_repo/backend/app/models/orders.py +24 -0
  92. blastradius_skill-1.0.1/tests/fixtures/fullstack_rbac_repo/backend/app/routers/__init__.py +1 -0
  93. blastradius_skill-1.0.1/tests/fixtures/fullstack_rbac_repo/backend/app/routers/admin.py +53 -0
  94. blastradius_skill-1.0.1/tests/fixtures/fullstack_rbac_repo/backend/app/routers/auth.py +28 -0
  95. blastradius_skill-1.0.1/tests/fixtures/fullstack_rbac_repo/backend/app/routers/orders.py +51 -0
  96. blastradius_skill-1.0.1/tests/fixtures/fullstack_rbac_repo/backend/tests/test_orders_api.py +20 -0
  97. blastradius_skill-1.0.1/tests/fixtures/fullstack_rbac_repo/backend/tests/test_rbac_api.py +25 -0
  98. blastradius_skill-1.0.1/tests/fixtures/fullstack_rbac_repo/frontend/next.config.mjs +13 -0
  99. blastradius_skill-1.0.1/tests/fixtures/fullstack_rbac_repo/frontend/package.json +15 -0
  100. blastradius_skill-1.0.1/tests/fixtures/fullstack_rbac_repo/frontend/src/app/dashboard/page.tsx +44 -0
  101. blastradius_skill-1.0.1/tests/fixtures/fullstack_rbac_repo/frontend/src/app/layout.tsx +33 -0
  102. blastradius_skill-1.0.1/tests/fixtures/fullstack_rbac_repo/frontend/src/components/Navbar.test.tsx +23 -0
  103. blastradius_skill-1.0.1/tests/fixtures/fullstack_rbac_repo/frontend/src/components/Navbar.tsx +301 -0
  104. blastradius_skill-1.0.1/tests/fixtures/fullstack_rbac_repo/frontend/src/hooks/useAuth.test.ts +19 -0
  105. blastradius_skill-1.0.1/tests/fixtures/fullstack_rbac_repo/frontend/src/hooks/useAuth.ts +43 -0
  106. blastradius_skill-1.0.1/tests/fixtures/fullstack_rbac_repo/frontend/src/lib/apiClient.ts +57 -0
  107. blastradius_skill-1.0.1/tests/fixtures/fullstack_rbac_repo/frontend/src/lib/serverSecret.ts +6 -0
  108. blastradius_skill-1.0.1/tests/fixtures/fullstack_rbac_repo/frontend/tsconfig.json +14 -0
  109. blastradius_skill-1.0.1/tests/fixtures/fullstack_rbac_repo/pyproject.toml +5 -0
  110. blastradius_skill-1.0.1/tests/fixtures/mini_repo/__init__.py +1 -0
  111. blastradius_skill-1.0.1/tests/fixtures/mini_repo/auth.py +17 -0
  112. blastradius_skill-1.0.1/tests/fixtures/mini_repo/cli.py +29 -0
  113. blastradius_skill-1.0.1/tests/fixtures/mini_repo/decorators.py +15 -0
  114. blastradius_skill-1.0.1/tests/fixtures/mini_repo/models/__init__.py +3 -0
  115. blastradius_skill-1.0.1/tests/fixtures/mini_repo/models/user.py +25 -0
  116. blastradius_skill-1.0.1/tests/fixtures/mini_repo/routes.py +25 -0
  117. blastradius_skill-1.0.1/tests/fixtures/mini_repo/tests/__init__.py +0 -0
  118. blastradius_skill-1.0.1/tests/fixtures/mini_repo/tests/test_auth.py +31 -0
  119. blastradius_skill-1.0.1/tests/fixtures/mini_repo/tests/test_routes.py +24 -0
  120. blastradius_skill-1.0.1/tests/fixtures/mini_repo/utils.py +20 -0
  121. blastradius_skill-1.0.1/tests/fixtures/mini_repo/workers.py +12 -0
  122. blastradius_skill-1.0.1/tests/fixtures/mini_ts_repo/src/components/UserCard.test.tsx +5 -0
  123. blastradius_skill-1.0.1/tests/fixtures/mini_ts_repo/src/components/UserCard.tsx +17 -0
  124. blastradius_skill-1.0.1/tests/fixtures/mini_ts_repo/src/pages/ProfilePage.tsx +9 -0
  125. blastradius_skill-1.0.1/tests/fixtures/mini_ts_repo/src/services/userService.test.ts +8 -0
  126. blastradius_skill-1.0.1/tests/fixtures/mini_ts_repo/src/services/userService.ts +20 -0
  127. blastradius_skill-1.0.1/tests/fixtures/mini_ts_repo/src/types.ts +7 -0
  128. blastradius_skill-1.0.1/tests/fixtures/mini_ts_repo/src/utils/extra.ts +3 -0
  129. blastradius_skill-1.0.1/tests/fixtures/mini_ts_repo/src/utils/format.ts +4 -0
  130. blastradius_skill-1.0.1/tests/fixtures/mini_ts_repo/src/utils/index.ts +2 -0
  131. blastradius_skill-1.0.1/tests/fixtures/mini_ts_repo/tsconfig.json +11 -0
  132. blastradius_skill-1.0.1/tests/fixtures/typecheck_samples/basedpyright_sample.json +221 -0
  133. blastradius_skill-1.0.1/tests/fixtures/typecheck_samples/tsc_sample.txt +68 -0
  134. blastradius_skill-1.0.1/tests/test_architecture.py +215 -0
  135. blastradius_skill-1.0.1/tests/test_benchmarks.py +81 -0
  136. blastradius_skill-1.0.1/tests/test_evals.py +33 -0
  137. blastradius_skill-1.0.1/tests/test_fixture.py +163 -0
  138. blastradius_skill-1.0.1/tests/test_indexer_and_resolver.py +384 -0
  139. blastradius_skill-1.0.1/tests/test_risk_and_contracts.py +236 -0
  140. blastradius_skill-1.0.1/tests/test_tools_and_server.py +446 -0
  141. blastradius_skill-1.0.1/tests/test_ts_and_trace_error.py +329 -0
  142. blastradius_skill-1.0.1/tests/test_v06_graph_and_fastapi.py +759 -0
  143. blastradius_skill-1.0.1/tests/test_v07_nextjs_and_verifier.py +784 -0
  144. blastradius_skill-1.0.1/tests/test_v08_cochange_coverage_cli.py +676 -0
  145. blastradius_skill-1.0.1/tests/test_v10_fullstack_benchmark.py +358 -0
  146. blastradius_skill-1.0.1/tests/test_verify_and_calibration.py +351 -0
@@ -0,0 +1,44 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ${{ matrix.os }}
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ os: [ubuntu-latest, windows-latest, macos-latest]
16
+ python-version: ["3.10", "3.13"]
17
+
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+
21
+ - name: Set up Python ${{ matrix.python-version }}
22
+ uses: actions/setup-python@v5
23
+ with:
24
+ python-version: ${{ matrix.python-version }}
25
+
26
+ - name: Install package and dev dependencies
27
+ run: |
28
+ python -m pip install --upgrade pip
29
+ pip install -e ".[dev]"
30
+
31
+ - name: Run linter
32
+ run: ruff check src tests scripts evals benchmarks
33
+
34
+ - name: Run type checker
35
+ run: mypy src
36
+
37
+ - name: Run test suite
38
+ run: python -m pytest -v
39
+
40
+ - name: Run evals
41
+ run: python evals/run_evals.py
42
+
43
+ - name: Run install and stdio MCP check
44
+ run: python scripts/install_check.py --stdio
@@ -0,0 +1,53 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ build:
9
+ name: Build wheel and sdist
10
+ runs-on: ubuntu-latest
11
+ # Holds zero publish permissions: only checks out code and uploads the
12
+ # built artifacts as a workflow artifact.
13
+ permissions:
14
+ contents: read
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+
18
+ - name: Set up Python
19
+ uses: actions/setup-python@v5
20
+ with:
21
+ python-version: "3.10"
22
+
23
+ - name: Install build backend
24
+ run: |
25
+ python -m pip install --upgrade pip
26
+ pip install build
27
+
28
+ - name: Build wheel and sdist
29
+ run: python -m build
30
+
31
+ - name: Upload distribution artifacts
32
+ uses: actions/upload-artifact@v4
33
+ with:
34
+ name: dist
35
+ path: dist/
36
+ retention-days: 7
37
+
38
+ publish:
39
+ name: Publish to PyPI
40
+ needs: build
41
+ runs-on: ubuntu-latest
42
+ environment: pypi
43
+ permissions:
44
+ id-token: write
45
+ steps:
46
+ - name: Download distribution artifacts
47
+ uses: actions/download-artifact@v4
48
+ with:
49
+ name: dist
50
+ path: dist/
51
+
52
+ - name: Publish to PyPI via Trusted Publishing
53
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,40 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.egg-info/
6
+ *.egg
7
+ dist/
8
+ build/
9
+ *.whl
10
+
11
+ # Virtual environments
12
+ .venv/
13
+ venv/
14
+ env/
15
+
16
+ # BlastRadius cache (generated per-repo)
17
+ .blastradius/
18
+
19
+ # IDE
20
+ .idea/
21
+ .vscode/
22
+ *.swp
23
+ *.swo
24
+ *~
25
+
26
+ # OS junk
27
+ .DS_Store
28
+ Thumbs.db
29
+ Desktop.ini
30
+
31
+ # Test / lint caches
32
+ .pytest_cache/
33
+ .mypy_cache/
34
+ .ruff_cache/
35
+ .coverage
36
+ coverage/
37
+ htmlcov/
38
+
39
+ # Benchmarks scratch
40
+ benchmarks/scratch/
@@ -0,0 +1,12 @@
1
+ {
2
+ "mcpServers": {
3
+ "blastradius": {
4
+ "command": "uvx",
5
+ "args": [
6
+ "--from",
7
+ "git+https://github.com/amitkumar-ak-55/blast-radius.git",
8
+ "blastradius-skill"
9
+ ]
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,83 @@
1
+ # AGENTS.md: BlastRadius
2
+
3
+ BlastRadius is a local-first agent skill and MCP server that runs on developer machines across Windows, macOS, and Linux. Code, config, and skill instructions must be clean, predictable, portable, and never a nuisance to the user's machine.
4
+
5
+
6
+ ## 1. Code quality
7
+
8
+ - Keep functions small and single-purpose. Return early and keep nesting shallow.
9
+ - Do not duplicate logic. Extract a helper or parameterize the difference.
10
+ - Use the standard library first (`ast`, `pathlib`, `hashlib`, `json`, `re`, `os`, `tempfile`). For v0.1 the only runtime dependencies are `networkx` and `mcp` (`FastMCP`). Add anything else only with a concrete need, and record why in the PR.
11
+ - Target the minimum Python version declared in `pyproject.toml`. Use only language features available in that version.
12
+ - Type-annotate public functions, dataclasses, and tool boundaries. Run the type checker in CI.
13
+ - Never swallow failures. No bare `except:` and no `except Exception: pass`. Report bad input or unparseable files as structured status or warnings.
14
+ - No dead code or speculative features. Items planned for v0.2+ (TypeScript, `trace_error`, architecture views, risk scoring) stay out until scheduled in `plan.md`.
15
+ - Docstrings on public APIs should be concise. Comments explain non-obvious invariants, not what the code already says.
16
+
17
+ ## 2. Repository hygiene
18
+
19
+ - Follow the layout in `plan.md`: package code in `src/blastradius/`, tests in `tests/`, skill docs in `SKILL.md` and `references/`, evals in `evals/`, benchmarks in `benchmarks/`.
20
+ - No stray files. Do not leave scratch scripts, debug dumps, `.bak` files, or temporary outputs in the repo root or source tree.
21
+ - The repo's `.gitignore` must exclude `.blastradius/`, `__pycache__/`, `.pytest_cache/`, `.mypy_cache/`, `.ruff_cache/`, `.venv/`, `dist/`, `build/`, `*.egg-info/`, and OS files (`.DS_Store`, `Thumbs.db`). Keep it accurate as tooling changes.
22
+ - Keep diffs minimal and scoped to the task. Preserve unrelated comments, docstrings, and formatting.
23
+ - Performance, token, or accuracy figures may appear in `README.md`, `SKILL.md`, or other docs only if they come from `benchmarks/results/`, and must cite the repo, task count, and run count.
24
+ - Use one formatter and one linter, configured in `pyproject.toml`. Do not reformat files you did not otherwise change.
25
+
26
+ ## 3. Cross-platform and zero-nuisance rules
27
+
28
+ Treat the user's machine and workspace as sacred.
29
+
30
+ **Paths**
31
+ - Use `pathlib.Path` for all filesystem work. Never build paths by string concatenation.
32
+ - Store graph keys and JSON output paths as POSIX paths (forward slashes), relative to `repo_root`, so output is identical on every OS.
33
+ - Never assume `os.getcwd()` is the target repository. Resolve `repo_root` in this order: the `repo_path` argument; then MCP roots or `BLASTRADIUS_REPO_ROOT`; then the nearest parent containing `.git` or `pyproject.toml`. If none applies, return a structured error. Do not guess.
34
+ - Every path a tool receives (`filepath`, `repo_path`) must resolve inside `repo_root` after symlink resolution. Reject anything outside it with a structured error. The server must not read arbitrary files on disk.
35
+ - Compare paths case-insensitively only where the filesystem requires it. Do not lowercase stored keys.
36
+
37
+ **Read-only toward user code**
38
+ - Do not modify, format, or touch user source files or git state during indexing or queries. No `git` write commands, ever.
39
+ - Write only inside `<repo_root>/.blastradius/`, and give that directory its own `.gitignore` containing `*`.
40
+ - Write the cache atomically: write to a temporary file in the same directory, then `os.replace` it into place. Multiple agent sessions can run at once, and a half-written `graph.json` must never be read.
41
+ - If the cache cannot be written, index in memory and report a warning. Do not crash.
42
+
43
+ **Skip junk**
44
+ - Always skip `.git`, `.hg`, `.svn`, `.venv`, `venv`, `env`, `node_modules`, `__pycache__`, `.mypy_cache`, `.pytest_cache`, `.ruff_cache`, `.blastradius`, `dist`, `build`, and `*.egg-info`.
45
+ - Respect the repo's `.gitignore`. Prefer `git ls-files` when the directory is a git repo and git is available. Otherwise fall back to a documented, tested subset of `.gitignore` rules, and say in the README which subset is supported.
46
+ - Guard against symlink loops by not following directory symlinks during the walk. Skip binary files by checking for NUL bytes in the first 8 KB.
47
+ - Skip any `.py` file larger than 1 MB and record a warning. Generated code above that size is almost never worth indexing.
48
+
49
+ **Never crash on messy repositories**
50
+ - Real repos contain syntax errors, non-UTF-8 files, unreadable files, and files with a UTF-8 byte order mark.
51
+ - Decode files as `utf-8-sig`, which accepts an optional BOM. If decoding fails, skip the file and record a warning. Never use `errors="replace"`, because it silently changes file content.
52
+ - Skip unparseable files with a warning and keep indexing the rest.
53
+ - Keep line numbers reliable across CRLF and LF line endings. Parse from decoded text with universal newlines, and test both.
54
+
55
+ **Protect MCP stdio**
56
+ - Never write to `stdout` in `src/blastradius/`. No `print()`, no banners. `stdout` belongs to MCP JSON-RPC.
57
+ - Configure logging to `stderr` only, at the start of the server entry point.
58
+
59
+ **Zero hidden footprint**
60
+ - No background daemons, no global config changes, no network calls, no telemetry, no package installs at runtime.
61
+
62
+ **Deterministic output**
63
+ - The same repo state must produce byte-identical tool output on every OS. Sort every list and dict key you emit. Do not include timestamps, absolute paths, or machine-specific values in tool results.
64
+
65
+ ## 4. Tool output and SKILL.md
66
+
67
+ **Tool output**
68
+ - Every tool returns a stable schema that includes `truncated: bool`. The default cap is 50.
69
+ - Sort by confidence (`direct`, then `via-import`, then `name-match-only`), then by file path, then by line number. Sort before truncating.
70
+ - Never drop statically visible matches to shorten a list. Never upgrade a `name-match-only` result to `direct`.
71
+ - Schema changes are breaking changes. Update `references/output-schema.md` in the same change.
72
+
73
+ **SKILL.md**
74
+ - Trigger only on multi-file or shared-symbol edits, signature changes, and blast-radius questions. Do not trigger on trivial local edits such as renaming a local variable.
75
+ - State the completeness guarantee and confidence levels in plain language. Tell the agent that `name-match-only` results are candidates to verify, not proof.
76
+ - Keep the trigger description short and specific. Test it against the trigger evals whenever it changes.
77
+
78
+ ## 5. Verification before finishing
79
+
80
+ - Write or update fixture and unit tests (`tests/fixtures/mini_repo/` and `tests/test_*.py`) alongside each change.
81
+ - Cover these edge cases explicitly: `repo_path` resolution, path containment and symlink escape, Windows and POSIX path normalization, CRLF and LF line endings, UTF-8 BOM files, syntax-error files, ignored directories such as `.venv`, `__init__.py` re-exports, line-range inputs, and truncation order.
82
+ - Run the test suite, the linter, the type checker, and `scripts/install_check.py` once it exists. Report only observed results, with the platform each was run on.
83
+ - CI must run the test suite on Windows, macOS, and Linux. Cross-platform claims are not verified until it does.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 amitkumar-ak-55
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,342 @@
1
+ Metadata-Version: 2.5
2
+ Name: blastradius-skill
3
+ Version: 1.0.1
4
+ Summary: Call-graph and blast-radius analysis skill for coding agents
5
+ Project-URL: Homepage, https://github.com/amitkumar-ak-55/blast-radius
6
+ Project-URL: Repository, https://github.com/amitkumar-ak-55/blast-radius
7
+ Project-URL: Issues, https://github.com/amitkumar-ak-55/blast-radius/issues
8
+ Author-email: amitkumar-ak-55 <sahooamitkumar2004@gmail.com>
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: agent,blast-radius,call-graph,mcp,static-analysis
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Software Development :: Quality Assurance
21
+ Requires-Python: >=3.10
22
+ Requires-Dist: mcp>=1.0
23
+ Requires-Dist: networkx>=3.0
24
+ Requires-Dist: tree-sitter-typescript>=0.23
25
+ Requires-Dist: tree-sitter>=0.23
26
+ Provides-Extra: dev
27
+ Requires-Dist: mypy>=1.11; extra == 'dev'
28
+ Requires-Dist: pytest>=8.0; extra == 'dev'
29
+ Requires-Dist: ruff>=0.8; extra == 'dev'
30
+ Description-Content-Type: text/markdown
31
+
32
+ # BlastRadius
33
+
34
+ Static call-graph and blast-radius analysis for Python and TypeScript/TSX coding agents, packaged as an installable agent skill (`SKILL.md`) backed by a local MCP server.
35
+
36
+ Before an agent modifies a shared function, class, or method, BlastRadius identifies downstream call sites, transitive dependents, and affected test files so the change and its callers can be updated in a single pass.
37
+
38
+ BlastRadius answers one question: *if this code changes, what else must change and which tests verify it?* It is not a code explanation tool and does not replace a type checker or test suite.
39
+
40
+ ## Known Limitations
41
+
42
+ BlastRadius lists everything statically visible in the repo. It cannot see dynamic calls, string-based lookups, or reflection.
43
+
44
+ Specifically, static AST analysis cannot resolve:
45
+
46
+ - **Dynamic dispatch:** `getattr(obj, name)()`, `globals()[name]()`, or dynamic imports.
47
+ - **String-based lookups:** Django URL string routes or `unittest.mock.patch("pkg.mod.fn")` (dotted string references are surfaced as `name-match-only` candidates, not confirmed calls).
48
+ - **Reflection and metaprogramming:** Methods generated by metaclasses or `__getattr__`.
49
+ - **Signature-mutating decorators:** Wrappers that alter parameter lists at runtime.
50
+ - **Monkeypatching:** Runtime attribute or module replacement.
51
+ - **Pytest fixture injection:** Fixtures bound by parameter name rather than import/call.
52
+ - **Dynamic TS/JS imports & reflection:** `import(expr)`, computed property calls (`obj[key]()`), or runtime `Proxy` handlers.
53
+ - **Minified or unmapped stack traces:** `trace_error` skips external frames and requires source-mapped repository paths (`webpack://`, Vite `/src/...`, or repo paths).
54
+ - **External packages:** Callers or definitions outside the target repository (`site-packages`, `node_modules`).
55
+
56
+ Results tagged `name-match-only` are unverified candidates to inspect, not proof of a dependency. See [references/limitations.md](references/limitations.md) for details.
57
+
58
+ ## How It Differs from Graphify
59
+
60
+ Graphify builds a repository-wide graph aimed at architecture navigation and explaining how a system fits together. BlastRadius is built specifically for edit-time impact: mapping planned line changes to enclosing definitions, walking reverse call/import edges with explicit confidence labels, and identifying affected test files before an edit is written.
61
+
62
+ ## Quickstart
63
+
64
+ ### 1. Run the MCP server
65
+
66
+ Run directly from GitHub with `uvx`:
67
+
68
+ ```bash
69
+ uvx --from git+https://github.com/amitkumar-ak-55/blast-radius.git blastradius-skill
70
+ ```
71
+
72
+ Or install into an environment with `pip`:
73
+
74
+ ```bash
75
+ pip install git+https://github.com/amitkumar-ak-55/blast-radius.git
76
+ ```
77
+
78
+ For local development from a clone:
79
+
80
+ ```bash
81
+ git clone https://github.com/amitkumar-ak-55/blast-radius.git
82
+ cd blast-radius
83
+ pip install -e .
84
+ ```
85
+
86
+ ### 2. One-command onboarding & MCP client setup
87
+
88
+ Initialize `.mcp.json`, Claude Code hooks/`CLAUDE.md`, or Cursor rules idempotently:
89
+
90
+ ```bash
91
+ # Configure Claude Code and Cursor in the target repository (writes portable command: "blastradius")
92
+ blastradius init --client all --repo .
93
+
94
+ # Optional local-only override when launching without PATH (do not commit generated MCP configs)
95
+ blastradius init --client all --repo . --absolute-path
96
+
97
+ # Inspect environment dependencies, external typecheckers, and cache state
98
+ blastradius doctor --repo .
99
+
100
+ # Run the MCP stdio server (same as `blastradius` with no arguments)
101
+ blastradius serve
102
+ ```
103
+
104
+ By default, `blastradius init` writes the portable `"command": "blastradius"` into `.mcp.json` and `.cursor/mcp.json` so configs stay shareable across machines and CI. If `blastradius` is not currently on `PATH`, `init` still writes the portable config and prints a `stderr` reminder to run `pipx ensurepath` (and restart your shell) or pass `--absolute-path` for a local machine-specific path. For `.claude/settings.json`, `init` selects a portable Python interpreter name (`python3` then `python` on POSIX; `python` then `py` on Windows; falling back to `python3`/`python` with a `stderr` warning if none is on `PATH`), and only writes an absolute interpreter path when `--absolute-path` is passed.
105
+
106
+ The `pre_edit_guard.py` hook installed by `init` is stdlib-only and always fails open (`exit 0`) once Python launches it. Note that if the configured interpreter name cannot be found on `PATH` (`exit 127` / Windows `9009`), that failure occurs before the script starts and cannot be caught inside `pre_edit_guard.py` (Claude Code reports non-`2` exits as non-blocking hook errors so edits still proceed). End-to-end latency per hook trigger is dominated by Python interpreter startup rather than the guard evaluation itself.
107
+
108
+ Or use `.mcp.json` (included in this repository):
109
+
110
+ ```json
111
+ {
112
+ "mcpServers": {
113
+ "blastradius": {
114
+ "command": "uvx",
115
+ "args": [
116
+ "--from",
117
+ "git+https://github.com/amitkumar-ak-55/blast-radius.git",
118
+ "blastradius",
119
+ "serve"
120
+ ]
121
+ }
122
+ }
123
+ }
124
+ ```
125
+
126
+ Or register via Claude Code CLI:
127
+
128
+ ```bash
129
+ claude mcp add blastradius -- uvx --from git+https://github.com/amitkumar-ak-55/blast-radius.git blastradius serve
130
+ ```
131
+
132
+ ### 3. Install the agent skill
133
+
134
+ Copy `SKILL.md` and `references/` into your client's skill directory:
135
+
136
+ ```bash
137
+ # Project-local cross-agent layout
138
+ mkdir -p .agents/skills/blastradius
139
+ cp SKILL.md .agents/skills/blastradius/
140
+ cp -r references .agents/skills/blastradius/
141
+
142
+ # Or Claude Code project skills
143
+ mkdir -p .claude/skills/blastradius
144
+ cp SKILL.md .claude/skills/blastradius/
145
+ cp -r references .claude/skills/blastradius/
146
+ ```
147
+
148
+ ### 4. Verify the installation
149
+
150
+ ```bash
151
+ python scripts/install_check.py
152
+ python scripts/install_check.py --stdio
153
+ ```
154
+
155
+ ## MCP Tools (5 Consolidated Tools)
156
+
157
+ All 5 consolidated tools operate locally over `stdio`, send no code off-machine, write diagnostics only to `stderr`, and resolve the repository root in order: `repo_path` argument, MCP client `roots` / `BLASTRADIUS_REPO_ROOT`, or nearest parent containing `.git` or `pyproject.toml`. Schema size is `3,663 chars` (`964` estimated tokens via `ceil(chars / 3.8)`), down `-27.35%` (`-363` tokens) from v0.5.0's 9-tool schema (`5,040 chars`, `1,327` est. tokens).
158
+
159
+ ### `get_blast_radius(filepath, modified_lines, change_type="signature", mutation_kind="breaking_change", max_tokens=3500, calibrated=false, repo_path=None)`
160
+
161
+ Maps planned edits (`42`, `[42, 43]`, or `"42-50"`) to enclosing definitions, runs Pareto-optimal reverse dependency traversal across calls, imports, FastAPI `Depends`/closures/routers, Pydantic `BaseModel` schemas, Next.js App Router layouts/middleware, JSX props, and cross-stack HTTP API contracts (`api_contract`), and merges symbol-keyed runtime coverage (`test_files[].source="runtime_coverage"`), historical `co_change_files`, scoped `blind_spots`, `"use client"` -> server-only `boundary_violations`, `edit_scope`, 2-tier hub packing under `max_tokens`, `stale_files` (LKG syntax-error protection), and explainable risk factors.
162
+
163
+ ### `get_symbol_context(symbol, scope="repo", include_body=false, repo_path=None)`
164
+
165
+ Replaces `get_symbol_callers` and `get_type_definition`. Returns signature, Pydantic `pydantic_fields`/`from_attributes`, typed React `jsx_props`, optional function/class body (`include_body=true`), and all static/dynamic callers sorted by confidence.
166
+
167
+ ### `verify_edit_impact(filepath=None, modified_lines=None, diff_text=None, test_output="", failed_tests=None, passed_tests=None, record_calibration=false, run_typecheck=true, repo_path=None)`
168
+
169
+ Compares pre-edit BlastRadius predictions against unified diffs (`diff_text` or read-only `git diff`), verifies diff containment against `edit_scope`, reconciles AST-derived `change_type` against per-PID pre-edit snapshots (or `HEAD`), runs optional local `basedpyright --outputjson` / `pyright --outputjson` / `tsc --noEmit` diagnostics when installed, parses `pytest` / `vitest` / `jest` test outcomes, and optionally records calibration in `.blastradius/calibration.json`.
170
+
171
+ ### `trace_error(traceback_text, repo_path=None)`
172
+
173
+ Parses pasted browser, React, Node.js, or Python stack traces, safely maps in-repo frames inside `repo_root` (ignoring `node_modules`, stdlib, and external paths), resolves enclosing definitions (including `<locals>` closures), and returns their direct callers and affected test files.
174
+
175
+ ### `get_architecture_view(view="summary", scope="repo", repo_path=None, layer_rules=None)`
176
+
177
+ Returns read-only structural views (`"summary"`, `"entry_points"`, `"core_modules"`, `"shared_utilities"`, `"critical_paths"`, `"module_boundaries"`, `"circular_dependencies"`, `"layers"`) plus `"calibration"` (historical verification run stats and calibrated risk weights).
178
+
179
+ ### Confidence Tags & Output Contract
180
+
181
+ Every tool returns deterministic JSON containing `truncated: bool` and relative POSIX paths only (never absolute paths or timestamps). If `repo_root` resolution, path containment, or input validation fails, the response includes an `error: str` field with `truncated: false`. Matches are sorted deterministically before applying the default 50-item cap:
182
+
183
+ 1. `direct` — confirmed through static import, local type binding, or module-level definition.
184
+ 2. `via-import` — reachable transitively through downstream calls, inheritance, or `__init__.py` re-exports.
185
+ 3. `name-match-only` — matching symbol or dotted string reference without static type confirmation.
186
+
187
+ Full payload definitions are documented in [references/output-schema.md](references/output-schema.md).
188
+
189
+ ## Example
190
+
191
+ When planning a signature change on `create_user` (lines 5–11 of `auth.py` in `tests/fixtures/mini_repo`), calling `get_blast_radius(filepath="auth.py", modified_lines="5-11")` returns:
192
+
193
+ ```json
194
+ {
195
+ "source_definitions": [
196
+ {
197
+ "name": "create_user",
198
+ "qualified_name": "auth.create_user",
199
+ "file": "auth.py",
200
+ "line_start": 5,
201
+ "line_end": 11
202
+ }
203
+ ],
204
+ "affected": [
205
+ {"file": "routes.py", "function": "handle_register", "line": 18, "confidence": "direct"},
206
+ {"file": "tests/test_auth.py", "function": "test_create_user", "line": 4, "confidence": "direct"},
207
+ {"file": "tests/test_auth.py", "function": "test_create_user_invalid_email", "line": 12, "confidence": "direct"},
208
+ {"file": "workers.py", "function": "send_welcome_email", "line": 5, "confidence": "direct"},
209
+ {"file": "cli.py", "function": "main", "line": 7, "confidence": "via-import"},
210
+ {"file": "tests/test_routes.py", "function": "test_handle_register", "line": 11, "confidence": "via-import"}
211
+ ],
212
+ "test_files": [
213
+ {"file": "tests/test_auth.py", "references": ["create_user"], "confidence": "direct"},
214
+ {"file": "tests/test_routes.py", "references": ["handle_register"], "confidence": "via-import"}
215
+ ],
216
+ "total_affected": 6,
217
+ "truncated": false
218
+ }
219
+ ```
220
+
221
+ ## Caching & Repository Hygiene
222
+
223
+ Parsed per-file AST facts are cached atomically (temporary file + `os.replace`) under `<repo_root>/.blastradius/cache.json` keyed by SHA-256 content hash, with an auto-created `.blastradius/.gitignore` containing `*`. On subsequent queries, only changed files are re-parsed and cross-file edges are re-resolved. If the repository is read-only, BlastRadius falls back to in-memory indexing and includes a warning.
224
+
225
+ File discovery skips `.git`, `.hg`, `.svn`, `.venv`, `venv`, `env`, `node_modules`, `__pycache__`, `.mypy_cache`, `.pytest_cache`, `.ruff_cache`, `.blastradius`, `dist`, `build`, `*.egg-info`, directory symlinks, symlinks resolving outside `repo_root`, files with NUL bytes in the first 8 KB, and Python files larger than 1 MB. Files are decoded with `utf-8-sig` and normalized across CRLF and LF endings.
226
+
227
+ When the target is a git repository and `git` is installed, BlastRadius prefers `git ls-files --cached --others --exclude-standard` for `.gitignore` handling. Otherwise, it falls back to a subset of root `.gitignore` rules supporting:
228
+
229
+ - Blank lines and `#` comments
230
+ - Directory rules ending in `/`
231
+ - Relative path globs containing `/` (`fnmatchcase`)
232
+ - Filename or path-segment globs without `/` (`fnmatchcase`)
233
+ - Negated patterns prefixed with `!`
234
+
235
+ (Nested `.gitignore` files, arbitrary-depth `**` globs, and `.git/info/exclude` require `git`.)
236
+
237
+ ## Development & Testing
238
+
239
+ ```bash
240
+ # Install editable package with dev tools
241
+ pip install -e ".[dev]"
242
+
243
+ # Run unit and fixture exact-match tests
244
+ python -m pytest -v
245
+
246
+ # Run linter and type checker
247
+ ruff check src tests scripts evals benchmarks
248
+ mypy src
249
+
250
+ # Run SKILL.md task eval graders and trigger checks
251
+ python evals/run_evals.py
252
+
253
+ # Run installation and stdio MCP smoke checks
254
+ python scripts/install_check.py --stdio
255
+ ```
256
+
257
+ Continuous integration is configured in [.github/workflows/ci.yml](.github/workflows/ci.yml) across Linux, macOS, and Windows.
258
+
259
+ ## Benchmarks
260
+
261
+ Raw benchmark data is committed in [benchmarks/results/static_eval.json](benchmarks/results/static_eval.json), [benchmarks/results/static_eval_ts.json](benchmarks/results/static_eval_ts.json), [benchmarks/results/fullstack_eval.json](benchmarks/results/fullstack_eval.json), and [benchmarks/results/git_replay_eval.json](benchmarks/results/git_replay_eval.json), and is reproducible via [benchmarks/run.py](benchmarks/run.py).
262
+
263
+ Timing (cold/warm latency) figures are environment-dependent: they were captured when the committed results were generated and vary by host, Python version, and disk speed, so absolute values differ from machine to machine. Re-run locally with `benchmarks/run.py` for your own numbers.
264
+
265
+ ### Python Static Analysis Evaluation (18 tasks, 3 pinned repos, n = 3 runs per task)
266
+
267
+ Evaluated across `pallets/itsdangerous` (`672971d`, 15 files), `pytest-dev/pluggy` (`baa68a2`, 36 files), and `pallets/click` (`08b803c`, 91 files), running `get_symbol_callers`, `get_blast_radius`, and `get_type_definition` on 18 refactoring targets (`6` per repository; cold index vs. cached warm query):
268
+
269
+ | Metric | Min | Median | Max | Condition |
270
+ | --- | --- | --- | --- | --- |
271
+ | Caller-file recall | 1.000 | 1.000 | 1.000 | Static graph (`n = 3` runs/task) |
272
+ | Confirmed caller precision (`direct` / `via-import`) | 1.000 | 1.000 | 1.000 | Static graph (`n = 3` runs/task) |
273
+ | Test-file recall | 0.500 | 1.000 | 1.000 | Static graph (`n = 3` runs/task; 17/18 at 1.000) |
274
+ | Cold query latency (index + 3 tools) | 238.0 ms | 454.3 ms | 1317.4 ms | Cleared `.blastradius/` per run (includes `git ls-files`) |
275
+ | Warm query latency (cached + 3 tools) | 184.1 ms | 238.8 ms | 419.3 ms | Cached `.blastradius/` + in-memory graph |
276
+ | Tool payload / full caller files ratio | 0.052 | 0.256 | 0.649 | Bounded JSON vs. reading caller files in full |
277
+
278
+ The one partial test-recall case (`pluggy-06-raise-wrapfail`) missed `testing/test_invocations.py` because that test invokes the target indirectly through `pluggy`'s dynamic `PluginManager.hook()` dispatch rather than a direct static call.
279
+
280
+ ### TypeScript Static Analysis Evaluation (8 tasks, 2 pinned repos, n = 3 runs per task)
281
+
282
+ Evaluated across `sindresorhus/ky` (`3541888`, 98 files) and `immerjs/immer` (`b80ac34`, 54 files), running `get_symbol_callers`, `get_blast_radius`, and `get_type_definition` on 8 refactoring targets (`4` per repository; cold index vs. cached warm query):
283
+
284
+ | Metric | Min | Median | Max | Condition |
285
+ | --- | --- | --- | --- | --- |
286
+ | Caller-file recall | 1.000 | 1.000 | 1.000 | Static graph (`n = 3` runs/task) |
287
+ | Confirmed caller precision (`direct` / `via-import`) | 1.000 | 1.000 | 1.000 | Static graph (`n = 3` runs/task) |
288
+ | Test-file recall | 1.000 | 1.000 | 1.000 | Static graph (`n = 3` runs/task) |
289
+ | Cold query latency (index + 3 tools) | 748.0 ms | 1204.0 ms | 1889.0 ms | Cleared `.blastradius/` per run (includes `git ls-files`) |
290
+ | Warm query latency (cached + 3 tools) | 302.2 ms | 391.5 ms | 624.4 ms | Cached `.blastradius/` + in-memory graph |
291
+ | Tool payload / full caller files ratio | 0.071 | 0.207 | 0.600 | Bounded JSON vs. reading caller files in full |
292
+
293
+ ### Full-Stack FastAPI + Next.js Evaluation (8 tasks, `fullstack_rbac_repo`, n = 3 runs per task)
294
+
295
+ Evaluated on the 26-file cross-stack monorepo **synthetic fixture built for this tool** ([tests/fixtures/fullstack_rbac_repo](tests/fixtures/fullstack_rbac_repo)) covering nested FastAPI `APIRouter` prefixes, `Depends` closures (`require_role`), Pydantic DTOs, `axios.create` baseURL HTTP contracts (`api_contract`), and Next.js App Router / JSX props, comparing BlastRadius `v1.0.0` against a naive identifier grep baseline:
296
+
297
+ | Metric | BlastRadius v1.0.0 (Median / Mean) | Naive Lexical Grep Baseline (Median / Mean) |
298
+ | --- | --- | --- |
299
+ | Caller-file recall | 1.000 / 1.000 | 0.333 / 0.299 |
300
+ | Caller-file precision | 0.938 / 0.921 | 1.000 / 0.750 |
301
+ | Caller F1 | 0.967 / 0.957 | 0.500 / 0.421 |
302
+ | Test-file recall | 1.000 / 1.000 | — |
303
+ | Cold / Warm query latency | 691.1 ms / 375.7 ms | — |
304
+
305
+ MCP schema overhead measured live from `mcp._tool_manager.list_tools()` (`ceil(chars / 3.8)`): `3,663 chars` (`964` est. tokens across 5 tools) vs. v0.5.0 baseline `5,040 chars` (`1,327` est. tokens across 9 tools), saving `363` estimated tokens (`-27.35%`).
306
+
307
+ ### Local Git Commit Replay Evaluation (9 code-only multi-file commits from early `blastradius` history, n = 1 run/commit)
308
+
309
+ Replayed across 9 pinned historical multi-file code commits from this repository's own early history ([git_replay_commits.json](benchmarks/tasks/git_replay_commits.json); `git archive` read-only parent snapshots; highest parent-caller modified symbol targeted per commit):
310
+
311
+ | Metric | BlastRadius v1.0.0 (Median / Mean) | Naive Lexical Grep Baseline (Median / Mean) |
312
+ | --- | --- | --- |
313
+ | Combined caller + test recall | 0.417 / 0.459 | 0.000 / 0.101 |
314
+ | Test-file recall | 1.000 / 0.704 | 0.333 / 0.482 |
315
+ | Combined precision | 0.143 / 0.229 | 0.000 / 0.138 |
316
+ | Combined F1 | 0.250 / 0.267 | 0.000 / 0.116 |
317
+
318
+ Milestone feature commits in a small library often create or update independent modules alongside a core change, capping single-symbol static F1 (`0.250` median / `0.267` mean); historical `co_change_files` complements static traversal once multi-file commits accumulate. On git-replay, precision (`0.143` median / `0.229` mean) is lower than recall (`0.417` median / `0.459` mean) likely because static analysis is an over-approximation: it reports name-match-only candidates, transitive dependents, and cross-stack HTTP contracts that may not actually change in a given commit (false positives), while its transitive reach catches most truly-affected files (higher recall).
319
+
320
+ ### Live Agent A/B Harness
321
+
322
+ [benchmarks/run.py](benchmarks/run.py) also provides `--mode agent` to compare `without_tools` vs. `with_tools` end-to-end using `codex exec`. Full live A/B results are not yet published because local `codex exec` runs hit the machine's usage cap during Phase 4; no unmeasured turn or token savings are claimed here. Users with an available `codex` CLI quota can run the agent A/B harness against the synthetic full-stack fixture with `--suite fullstack --mode agent`.
323
+
324
+ Reproduce locally:
325
+
326
+ ```bash
327
+ # Static evaluation across all 18 Python tasks
328
+ python benchmarks/run.py --mode static --runs 3
329
+
330
+ # Static evaluation across all 8 TypeScript tasks
331
+ python benchmarks/run.py --suite typescript --mode static --runs 3
332
+
333
+ # Static evaluation across the 8 full-stack RBAC tasks (zero network required)
334
+ python benchmarks/run.py --suite fullstack --mode static --runs 3
335
+
336
+ # Read-only historical commit replay on the local git repo
337
+ python benchmarks/run.py --mode git-replay --runs 1 --max-commits 15
338
+ ```
339
+
340
+ ## License
341
+
342
+ MIT — see [LICENSE](LICENSE).