Spaces:
Sleeping
Sleeping
Commit ·
ade7c8d
1
Parent(s): babc153
feat: final submission — model fix, README, Dockerfile
Browse files- code-review-env/.env.example +5 -0
- code-review-env/Dockerfile +2 -1
- code-review-env/README.md +113 -414
- code-review-env/env/runtime_config.py +4 -4
- code-review-env/graders/hard_grader.py +7 -2
- code-review-env/inference.py +5 -4
- code-review-env/outputs/training/deterministic_findings.jsonl +73 -0
- code-review-env/outputs/weights/hf.coQwenQwen2.5-Coder-7B-Instruct-GGUFlatest.manifest.json +7 -0
- code-review-env/server/app.py +1 -1
code-review-env/.env.example
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
API_BASE_URL=http://localhost:11434/v1
|
| 2 |
+
MODEL_NAME=hf.co/Qwen/Qwen2.5-Coder-7B-Instruct-GGUF:latest
|
| 3 |
+
HF_TOKEN=your_token_here
|
| 4 |
+
GRAPHREVIEW_SEMGREP_ENABLED=false
|
| 5 |
+
GRAPHREVIEW_QWEN_GGUF_PATH=/usr/share/ollama/.ollama/models/blobs/sha256-509287f78cb4d4cf6b3843734733b914b2c158e43e22a7f4bf5e963800894d3c
|
code-review-env/Dockerfile
CHANGED
|
@@ -4,4 +4,5 @@ WORKDIR /app
|
|
| 4 |
COPY requirements.txt /app/
|
| 5 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 6 |
COPY . /app
|
| 7 |
-
|
|
|
|
|
|
| 4 |
COPY requirements.txt /app/
|
| 5 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 6 |
COPY . /app
|
| 7 |
+
RUN python -m db.seed sample_project/ --force
|
| 8 |
+
CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860"]
|
code-review-env/README.md
CHANGED
|
@@ -1,428 +1,127 @@
|
|
| 1 |
-
#
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
-
|
| 10 |
-
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
- Added deterministic analyzer run/finding persistence (`AnalyzerRun`, `AnalyzerFinding`).
|
| 49 |
-
- Added training harness with GGUF weight verification and non-regression checks.
|
| 50 |
-
|
| 51 |
-
Phase 8:
|
| 52 |
-
|
| 53 |
-
- Expanded analyzer pipeline to include pylint, pyflakes, bandit, mypy, pyright, semgrep, and vulture.
|
| 54 |
-
- Switched easy/medium/hard graders to analyzer-native truth mapping by task level.
|
| 55 |
-
- Refactored hard grading to deterministic semgrep + graph attribution checks.
|
| 56 |
-
- Added training run registry in SQLite (`TrainingRun`) with precision/recall and drift metrics.
|
| 57 |
-
- Added canonical challenge fixture and validator in `sample_project_canonical/`.
|
| 58 |
-
- Extended FastAPI UI with training pipeline controls and run history.
|
| 59 |
-
|
| 60 |
-
## Core Runtime Components
|
| 61 |
-
|
| 62 |
-
- `env/environment.py`
|
| 63 |
-
- Persistent episode runtime over SQLite.
|
| 64 |
-
- Deterministic module progression and reward accumulation.
|
| 65 |
-
- Task-aware reset/step/state semantics.
|
| 66 |
-
|
| 67 |
-
- `env/state.py`
|
| 68 |
-
- Strict Pydantic state models for episode and graph status.
|
| 69 |
-
|
| 70 |
-
- `tasks/task_registry.py`
|
| 71 |
-
- Static task registration and dependency-aware module resolution.
|
| 72 |
-
- Direct review policy:
|
| 73 |
-
- easy task: optional direct module override only.
|
| 74 |
-
- medium/hard tasks: module override expands one-hop dependencies for context reliability.
|
| 75 |
-
|
| 76 |
-
- `server/app.py`
|
| 77 |
-
- API endpoints:
|
| 78 |
-
- `POST /reset`
|
| 79 |
-
- `POST /step`
|
| 80 |
-
- `GET /state`
|
| 81 |
-
- `GET /health`
|
| 82 |
-
- `GET /tasks`
|
| 83 |
-
- `GET /debug/state`
|
| 84 |
-
- `POST /debug/reset-annotations`
|
| 85 |
-
- `POST /tasks/{task_id}/run`
|
| 86 |
-
- `GET /reports/accuracy`
|
| 87 |
-
- `POST /reports/generate`
|
| 88 |
-
- `GET /graph/export`
|
| 89 |
-
- `POST /analysis/run`
|
| 90 |
-
- `POST /training/bootstrap`
|
| 91 |
-
- `POST /training/run`
|
| 92 |
-
- `GET /training/runs`
|
| 93 |
-
|
| 94 |
-
- `visualizer/pyvis_renderer.py`
|
| 95 |
-
- Renders dependency graph with review-aware colors and edge-type styling.
|
| 96 |
-
- Produces standalone HTML suitable for local and hosted viewing.
|
| 97 |
-
|
| 98 |
-
- `visualizer/report_generator.py`
|
| 99 |
-
- Produces:
|
| 100 |
-
- `*_report.md`
|
| 101 |
-
- `*_report.json`
|
| 102 |
-
- `*_graph.html`
|
| 103 |
-
- Includes:
|
| 104 |
-
- module-level summaries
|
| 105 |
-
- security findings analysis
|
| 106 |
-
- cascade attribution summaries
|
| 107 |
-
- RL trajectory integrity notes
|
| 108 |
-
- confidence scoring metrics
|
| 109 |
-
|
| 110 |
-
## Database and Turso Support
|
| 111 |
-
|
| 112 |
-
The project remains SQLite-first and supports Turso/libSQL via environment variables.
|
| 113 |
-
|
| 114 |
-
Primary DB configuration:
|
| 115 |
-
|
| 116 |
-
- `GRAPHREVIEW_DATABASE_URL`
|
| 117 |
-
- If set, used directly by SQLAlchemy.
|
| 118 |
-
- Works for local SQLite and SQLAlchemy-compatible backends.
|
| 119 |
-
|
| 120 |
-
Turso/libSQL fallback configuration:
|
| 121 |
-
|
| 122 |
-
- `TURSO_DATABASE_URL` (example: `libsql://your-db.turso.io`)
|
| 123 |
-
- `TURSO_AUTH_TOKEN`
|
| 124 |
-
- `GRAPHREVIEW_REMOTE_SQLITE_URL` (alias of `TURSO_DATABASE_URL`)
|
| 125 |
-
- `GRAPHREVIEW_REMOTE_SQLITE_AUTH_TOKEN` (alias of `TURSO_AUTH_TOKEN`)
|
| 126 |
-
|
| 127 |
-
When `GRAPHREVIEW_DATABASE_URL` is not set and `TURSO_DATABASE_URL` is set, engine is built as:
|
| 128 |
-
|
| 129 |
-
- `sqlite+${TURSO_DATABASE_URL}?secure=true`
|
| 130 |
-
with `auth_token` connect arg.
|
| 131 |
-
|
| 132 |
-
## LLM and Runtime Env Vars
|
| 133 |
-
|
| 134 |
-
`.env` at project root is auto-loaded by runtime configuration, DB initialization, and server startup.
|
| 135 |
-
|
| 136 |
-
Judge settings:
|
| 137 |
-
|
| 138 |
-
- `GRAPHREVIEW_JUDGE_PROVIDER` (default `ollama_openai_compat`)
|
| 139 |
-
- `GRAPHREVIEW_JUDGE_MODEL` (default `gemma4:e4b`)
|
| 140 |
-
- `GRAPHREVIEW_JUDGE_BASE_URL` (default `http://localhost:11434/v1`)
|
| 141 |
-
- `GRAPHREVIEW_JUDGE_API_KEY` (default `ollama`)
|
| 142 |
-
- `GRAPHREVIEW_JUDGE_TIMEOUT_SECONDS` (default `8`)
|
| 143 |
-
- `GRAPHREVIEW_JUDGE_ENABLED` (`true|false`, default `true`)
|
| 144 |
-
- `GRAPHREVIEW_JUDGE_MAX_CALLS` (default `200`)
|
| 145 |
-
- `GRAPHREVIEW_JUDGE_MAX_CONSECUTIVE_FAILURES` (default `3`)
|
| 146 |
-
- `GRAPHREVIEW_JUDGE_THINK` (`false|true|low|medium|high`, default `false`)
|
| 147 |
-
|
| 148 |
-
Verifier and adaptive fusion settings:
|
| 149 |
-
|
| 150 |
-
- `GRAPHREVIEW_VERIFIER_ENABLED` (default `true`)
|
| 151 |
-
- `GRAPHREVIEW_VERIFIER_PROVIDER`
|
| 152 |
-
- `GRAPHREVIEW_VERIFIER_MODEL`
|
| 153 |
-
- `GRAPHREVIEW_VERIFIER_BASE_URL`
|
| 154 |
-
- `GRAPHREVIEW_VERIFIER_API_KEY`
|
| 155 |
-
- `GRAPHREVIEW_VERIFIER_TIMEOUT_SECONDS`
|
| 156 |
-
- `GRAPHREVIEW_JUDGE_WEIGHT_DETERMINISTIC` (default `0.5`)
|
| 157 |
-
- `GRAPHREVIEW_JUDGE_WEIGHT_PRIMARY` (default `0.3`)
|
| 158 |
-
- `GRAPHREVIEW_JUDGE_WEIGHT_VERIFIER` (default `0.2`)
|
| 159 |
-
- `GRAPHREVIEW_JUDGE_DISAGREEMENT_THRESHOLD` (default `0.5`)
|
| 160 |
-
|
| 161 |
-
Edge summary settings:
|
| 162 |
-
|
| 163 |
-
- `GRAPHREVIEW_EDGE_SUMMARY_ENABLED` (default `false`, enable when you want LLM edge summaries)
|
| 164 |
-
- `GRAPHREVIEW_EDGE_SUMMARY_MODEL`
|
| 165 |
-
- `GRAPHREVIEW_EDGE_SUMMARY_BASE_URL`
|
| 166 |
-
- `GRAPHREVIEW_EDGE_SUMMARY_API_KEY`
|
| 167 |
-
- `GRAPHREVIEW_EDGE_SUMMARY_TIMEOUT_SECONDS`
|
| 168 |
-
- `GRAPHREVIEW_EDGE_SUMMARY_MAX_CALLS`
|
| 169 |
-
|
| 170 |
-
LoRA trajectory hooks:
|
| 171 |
-
|
| 172 |
-
- `GRAPHREVIEW_LORA_ENABLED` (default `false`)
|
| 173 |
-
- `GRAPHREVIEW_LORA_DATA_PATH` (default `outputs/lora/transitions.jsonl`)
|
| 174 |
-
|
| 175 |
-
Hard autonomous issue finder (hard stage):
|
| 176 |
-
|
| 177 |
-
- `GRAPHREVIEW_HARD_ISSUE_FINDER_ENABLED` (default `true`)
|
| 178 |
-
- `GRAPHREVIEW_HARD_ISSUE_FINDER_MODEL`
|
| 179 |
-
- `GRAPHREVIEW_HARD_ISSUE_FINDER_BASE_URL`
|
| 180 |
-
- `GRAPHREVIEW_HARD_ISSUE_FINDER_API_KEY`
|
| 181 |
-
- `GRAPHREVIEW_HARD_ISSUE_FINDER_TIMEOUT_SECONDS`
|
| 182 |
-
- `GRAPHREVIEW_HARD_ISSUE_FINDER_MAX_ISSUES`
|
| 183 |
-
- `GRAPHREVIEW_HARD_PROPOSAL_MIN_CONFIDENCE` (default `0.70`)
|
| 184 |
-
|
| 185 |
-
Hard stage behavior is layered:
|
| 186 |
-
|
| 187 |
-
1. deterministic signals and semantic checks,
|
| 188 |
-
2. LLM proposes new bug hypotheses,
|
| 189 |
-
3. strict precision filters drop low-confidence or weak-evidence claims,
|
| 190 |
-
4. only accepted issues are converted into review actions.
|
| 191 |
-
|
| 192 |
-
`run_project` mode wiring:
|
| 193 |
-
|
| 194 |
-
- `--llm-mode fast`: disables judge, verifier, and hard issue finder.
|
| 195 |
-
- `--llm-mode judge`: enables primary judge and hard issue finder.
|
| 196 |
-
- `--llm-mode fused`: enables primary+verifier and hard issue finder.
|
| 197 |
-
|
| 198 |
-
Generate a LoRA-ready SFT dataset from transitions:
|
| 199 |
-
|
| 200 |
-
```bash
|
| 201 |
-
python -m llm.lora_finetune --transitions outputs/lora/transitions.jsonl --output outputs/lora/sft_dataset.jsonl
|
| 202 |
-
```
|
| 203 |
-
|
| 204 |
-
General runtime settings:
|
| 205 |
-
|
| 206 |
-
- `GRAPHREVIEW_SOURCE_ROOT` (default `sample_project`)
|
| 207 |
-
- `GRAPHREVIEW_DB_PATH` (optional local DB path)
|
| 208 |
-
- `GRAPHREVIEW_DB_ECHO` (`true|false`, default `false`)
|
| 209 |
-
- `GRAPHREVIEW_MAX_STEPS_PER_EPISODE` (default `80`)
|
| 210 |
-
- `GRAPHREVIEW_MAX_FILES` (default `5000`)
|
| 211 |
-
- `GRAPHREVIEW_SEED_WORKERS` (default `min(4, cpu_count)`)
|
| 212 |
-
- `GRAPHREVIEW_PROGRESS` (`true|false`, default `true`)
|
| 213 |
-
- `GRAPHREVIEW_OUTPUT_DIR` (optional report output folder, default `outputs`)
|
| 214 |
|
| 215 |
## Quickstart
|
| 216 |
|
| 217 |
```bash
|
|
|
|
| 218 |
pip install -r requirements.txt
|
| 219 |
-
python -m db.seed sample_project/
|
| 220 |
-
uvicorn server.app:app --host 0.0.0.0 --port 8000
|
| 221 |
-
```
|
| 222 |
-
|
| 223 |
-
Run API smoke checks:
|
| 224 |
-
|
| 225 |
-
```bash
|
| 226 |
-
curl -s http://localhost:8000/health
|
| 227 |
-
curl -s http://localhost:8000/tasks
|
| 228 |
-
```
|
| 229 |
-
|
| 230 |
-
## Unified One-Command Runner
|
| 231 |
-
|
| 232 |
-
Run seed + easy/medium/hard reviews + artifact generation on any target codebase:
|
| 233 |
-
|
| 234 |
-
```bash
|
| 235 |
-
graphreview /absolute/path/to/your/codebase --force-seed
|
| 236 |
-
```
|
| 237 |
-
|
| 238 |
-
By default, this opens an interactive prompt and starts in full fused mode unless you choose a faster option.
|
| 239 |
-
|
| 240 |
-
Current behavior:
|
| 241 |
|
| 242 |
-
|
| 243 |
-
-
|
| 244 |
-
- You can choose mode, edge summaries, levels, thinking level, and reasoning effort each run.
|
| 245 |
-
- Use `--no-prompt` for CI/non-interactive runs.
|
| 246 |
-
|
| 247 |
-
LLM modes:
|
| 248 |
-
|
| 249 |
-
```bash
|
| 250 |
-
# Fast deterministic run (default)
|
| 251 |
-
graphreview /absolute/path/to/your/codebase --force-seed --llm-mode fast --no-prompt
|
| 252 |
-
|
| 253 |
-
# Primary judge only
|
| 254 |
-
graphreview /absolute/path/to/your/codebase --force-seed --llm-mode judge --no-prompt
|
| 255 |
-
|
| 256 |
-
# Primary + verifier fusion (slowest)
|
| 257 |
-
graphreview /absolute/path/to/your/codebase --force-seed --llm-mode fused --edge-summary --no-prompt
|
| 258 |
-
|
| 259 |
-
# Judge with explicit thinking settings
|
| 260 |
-
graphreview /absolute/path/to/your/codebase --force-seed --llm-mode judge --think-level medium --reasoning-effort medium --no-prompt
|
| 261 |
-
```
|
| 262 |
-
|
| 263 |
-
Equivalent without installing entrypoints:
|
| 264 |
-
|
| 265 |
-
```bash
|
| 266 |
-
python run_project.py /absolute/path/to/your/codebase --force-seed
|
| 267 |
-
```
|
| 268 |
-
|
| 269 |
-
Optional focused run:
|
| 270 |
-
|
| 271 |
-
```bash
|
| 272 |
-
graphreview /absolute/path/to/your/codebase --modules checkout auth --filter-hops 1 --report-prefix myrun
|
| 273 |
-
```
|
| 274 |
-
|
| 275 |
-
## Direct Module Review (Phase 4)
|
| 276 |
-
|
| 277 |
-
Example: run `logic_review` with explicit module focus:
|
| 278 |
-
|
| 279 |
-
```bash
|
| 280 |
-
curl -s -X POST http://localhost:8000/reset \
|
| 281 |
-
-H "content-type: application/json" \
|
| 282 |
-
-d '{"task_id":"logic_review","module_override":["checkout"]}'
|
| 283 |
-
```
|
| 284 |
-
|
| 285 |
-
Policy behavior:
|
| 286 |
-
|
| 287 |
-
- For medium/hard tasks, module overrides are automatically expanded to one-hop dependencies and dependents.
|
| 288 |
-
- This preserves dependency context quality for cascade reasoning.
|
| 289 |
-
|
| 290 |
-
CLI module-filtered execution (generic, real projects supported):
|
| 291 |
-
|
| 292 |
-
```bash
|
| 293 |
-
python -m graders.review_runner /path/to/project \
|
| 294 |
-
--grader hard \
|
| 295 |
-
--force-seed \
|
| 296 |
-
--modules checkout auth \
|
| 297 |
-
--filter-hops 1 \
|
| 298 |
-
--report \
|
| 299 |
-
--output-dir outputs/real_project \
|
| 300 |
-
--report-prefix real_project
|
| 301 |
-
```
|
| 302 |
-
|
| 303 |
-
This mode keeps review scope connected to selected modules by traversing related dependencies.
|
| 304 |
-
|
| 305 |
-
API report generation (future UI/server integration):
|
| 306 |
-
|
| 307 |
-
```bash
|
| 308 |
-
curl -s -X POST http://localhost:8000/reports/generate \
|
| 309 |
-
-H "content-type: application/json" \
|
| 310 |
-
-d '{"module_override":["checkout"],"hops":1,"output_dir":"outputs/api"}'
|
| 311 |
-
```
|
| 312 |
-
|
| 313 |
-
Frontend results console (served by uvicorn app):
|
| 314 |
-
|
| 315 |
-
- `GET /` opens the report browser UI.
|
| 316 |
-
- `GET /ui/results` lists discovered `*_report.json` artifacts under `GRAPHREVIEW_OUTPUT_DIR`.
|
| 317 |
-
- `GET /ui/result?report_path=...` returns report payload + DB schema columns + connectivity diagnostics.
|
| 318 |
-
- `GET /artifacts/...` serves generated HTML/JSON/Markdown assets for direct viewing.
|
| 319 |
-
|
| 320 |
-
Training and analyzer workflow in UI:
|
| 321 |
-
|
| 322 |
-
- Open the `Training` tab:
|
| 323 |
-
- `Run Training Bootstrap` verifies Qwen GGUF manifest + checksum.
|
| 324 |
-
- `Run Training Episode` executes `inference.py`, persists run metrics to SQLite, and refreshes run history.
|
| 325 |
-
- Open the `Deterministic Analysis` tab:
|
| 326 |
-
- runs full analyzer stack and persists normalized findings.
|
| 327 |
-
|
| 328 |
-
Equivalent training API calls:
|
| 329 |
-
|
| 330 |
-
```bash
|
| 331 |
-
curl -s -X POST http://localhost:8000/training/bootstrap
|
| 332 |
-
curl -s -X POST http://localhost:8000/training/run -H "content-type: application/json" -d '{"force_seed":false}'
|
| 333 |
-
curl -s http://localhost:8000/training/runs?limit=20
|
| 334 |
-
```
|
| 335 |
-
|
| 336 |
-
Canonical challenge fixture:
|
| 337 |
-
|
| 338 |
-
- `sample_project_canonical/` contains the exact 10-file challenge fixture.
|
| 339 |
-
- Validate fixture layout and bug signatures with:
|
| 340 |
-
|
| 341 |
-
```bash
|
| 342 |
-
python -m tasks.validate_canonical_fixture
|
| 343 |
-
```
|
| 344 |
|
| 345 |
-
|
|
|
|
| 346 |
|
| 347 |
-
|
| 348 |
-
python
|
| 349 |
```
|
| 350 |
|
| 351 |
-
##
|
| 352 |
-
|
| 353 |
-
Verified on `sample_project` by running each task with deterministic action generation and comparing stored review actions against persisted linter findings.
|
| 354 |
-
|
| 355 |
-
Observed run (current implementation):
|
| 356 |
-
|
| 357 |
-
- `style_review`: precision `1.0`, recall `1.0`
|
| 358 |
-
- `logic_review`: precision `1.0`, recall `1.0`
|
| 359 |
-
- `cascade_review`: precision `1.0`, recall `1.0`
|
| 360 |
-
|
| 361 |
-
Notes:
|
| 362 |
-
|
| 363 |
-
- Accuracy endpoint computes precision/recall from persisted annotations and module findings.
|
| 364 |
-
- Hard grader stores judge metadata for auditability in structured annotation payloads.
|
| 365 |
-
|
| 366 |
-
## Confidence Scoring Policy (Phase 5)
|
| 367 |
-
|
| 368 |
-
Confidence score is designed to generalize beyond sample fixtures. It is not recall-only.
|
| 369 |
-
|
| 370 |
-
Computed metrics:
|
| 371 |
-
|
| 372 |
-
- precision
|
| 373 |
-
- recall
|
| 374 |
-
- f1
|
| 375 |
-
- severity-weighted finding coverage
|
| 376 |
-
- security finding coverage (Bandit findings matched by review flags)
|
| 377 |
-
- dependency attribution validity (graph-backed)
|
| 378 |
-
- consistency (penalizes contradictory terminal actions)
|
| 379 |
-
|
| 380 |
-
Weighted confidence formula:
|
| 381 |
-
|
| 382 |
-
- `0.35 * f1`
|
| 383 |
-
- `0.20 * severity_weighted_coverage`
|
| 384 |
-
- `0.15 * security_coverage`
|
| 385 |
-
- `0.20 * dependency_attribution_validity`
|
| 386 |
-
- `0.10 * consistency`
|
| 387 |
-
|
| 388 |
-
This design rewards useful review behavior on unseen modules where raw recall alone can be misleading.
|
| 389 |
-
|
| 390 |
-
## Visualization and Reporting Output
|
| 391 |
-
|
| 392 |
-
Generated artifacts include:
|
| 393 |
-
|
| 394 |
-
- Interactive graph with color-coded review status and edge-type styling.
|
| 395 |
-
- Markdown report with module summaries, security analysis, and cascade attribution details.
|
| 396 |
-
- JSON report with machine-readable nodes, edges, reviews, and quality metrics.
|
| 397 |
-
|
| 398 |
-
Security report behavior:
|
| 399 |
-
|
| 400 |
-
- Security findings are listed per module with severity/code/line/message.
|
| 401 |
-
- Reports call out what is wrong and whether reviews covered each security signal.
|
| 402 |
-
- Cascade attributions are listed with step/action/reward evidence.
|
| 403 |
-
|
| 404 |
-
## Testing
|
| 405 |
-
|
| 406 |
-
Targeted regression + phase tests:
|
| 407 |
|
| 408 |
```bash
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
|
|
|
|
|
|
|
|
|
|
| 416 |
```
|
| 417 |
|
| 418 |
-
##
|
| 419 |
-
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
|
| 428 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GraphReview — Dependency-Aware RL Environment for Python Code Review
|
| 2 |
+
|
| 3 |
+
GraphReview is an OpenEnv-compliant reinforcement learning environment where an LLM
|
| 4 |
+
agent learns to review Python code with full dependency graph awareness.
|
| 5 |
+
|
| 6 |
+
## What it does
|
| 7 |
+
|
| 8 |
+
- Parses a Python codebase into a persistent SQLite-backed dependency graph
|
| 9 |
+
- Pre-computes ground truth linter findings (pylint + bandit) at seed time
|
| 10 |
+
- Presents an agent with one module at a time, with compressed AST summaries of neighbors
|
| 11 |
+
- Scores agent actions against real ground truth — no training data needed
|
| 12 |
+
- Accumulates review annotations back onto graph nodes
|
| 13 |
+
|
| 14 |
+
## Architecture
|
| 15 |
+
|
| 16 |
+
````
|
| 17 |
+
Codebase (.py files)
|
| 18 |
+
│
|
| 19 |
+
▼
|
| 20 |
+
db/seed.py ──► SQLite DB (modules, edges, linter_flags)
|
| 21 |
+
│
|
| 22 |
+
▼
|
| 23 |
+
env/environment.py
|
| 24 |
+
┌───────────────────────────────────┐
|
| 25 |
+
│ reset() → CodeObservation │
|
| 26 |
+
│ step(ReviewAction) → reward │
|
| 27 |
+
│ state() → GraphState │
|
| 28 |
+
└───────────────────────────────────┘
|
| 29 |
+
│
|
| 30 |
+
▼
|
| 31 |
+
graders/
|
| 32 |
+
├── easy_grader.py (linter match — deterministic)
|
| 33 |
+
├── medium_grader.py (AST + keyword match — deterministic)
|
| 34 |
+
└── hard_grader.py (graph consistency + LLM judge — temperature=0)
|
| 35 |
+
│
|
| 36 |
+
▼
|
| 37 |
+
inference.py (baseline agent — OpenAI-compatible client)
|
| 38 |
+
````
|
| 39 |
+
|
| 40 |
+
## Tasks
|
| 41 |
+
|
| 42 |
+
| Task | Difficulty | Description |
|
| 43 |
+
|------|-----------|-------------|
|
| 44 |
+
| style_review | Easy | Flag style/linting violations in a single module |
|
| 45 |
+
| logic_review | Medium | Identify null-reference logic bug with dependency context |
|
| 46 |
+
| cascade_review | Hard | Trace a bug from root cause across 3 modules |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
|
| 48 |
## Quickstart
|
| 49 |
|
| 50 |
```bash
|
| 51 |
+
# Install dependencies
|
| 52 |
pip install -r requirements.txt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
+
# Seed the database (parse codebase, run linters, store graph)
|
| 55 |
+
python -m db.seed sample_project/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
+
# Start the API server
|
| 58 |
+
uvicorn server.app:app --host 0.0.0.0 --port 8000
|
| 59 |
|
| 60 |
+
# Run the baseline inference agent
|
| 61 |
+
python inference.py sample_project
|
| 62 |
```
|
| 63 |
|
| 64 |
+
## Environment Variables
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
|
| 66 |
```bash
|
| 67 |
+
# LLM provider (any OpenAI-compatible endpoint)
|
| 68 |
+
API_BASE_URL=http://localhost:11434/v1 # Ollama default; use https://api.openai.com/v1 for OpenAI
|
| 69 |
+
MODEL_NAME=hf.co/Qwen/Qwen2.5-Coder-7B-Instruct-GGUF:latest
|
| 70 |
+
HF_TOKEN=your_token_here # HuggingFace token / API key
|
| 71 |
+
|
| 72 |
+
# Optional
|
| 73 |
+
GRAPHREVIEW_OUTPUT_DIR=outputs
|
| 74 |
+
GRAPHREVIEW_SEMGREP_ENABLED=false
|
| 75 |
+
RL_MAX_STEPS=20
|
| 76 |
+
RL_TASK_TIMEOUT=300
|
| 77 |
```
|
| 78 |
|
| 79 |
+
## Supported LLM Providers
|
| 80 |
+
|
| 81 |
+
GraphReview works with any OpenAI-compatible endpoint:
|
| 82 |
+
|
| 83 |
+
| Provider | API_BASE_URL | MODEL_NAME example |
|
| 84 |
+
|----------|-------------|-------------------|
|
| 85 |
+
| Ollama (local) | http://localhost:11434/v1 | hf.co/Qwen/Qwen2.5-Coder-7B-Instruct-GGUF:latest |
|
| 86 |
+
| OpenAI | https://api.openai.com/v1 | gpt-4o-mini |
|
| 87 |
+
| Custom | your endpoint | your model |
|
| 88 |
+
|
| 89 |
+
## Action Space
|
| 90 |
+
|
| 91 |
+
| Action | Description | Reward |
|
| 92 |
+
|--------|-------------|--------|
|
| 93 |
+
| FLAG_STYLE | Style/formatting issue | +0.5 if matches linter |
|
| 94 |
+
| FLAG_BUG | Logic error | +0.5 if matches linter |
|
| 95 |
+
| FLAG_SECURITY | Security vulnerability | +0.5 if matches linter |
|
| 96 |
+
| FLAG_DEPENDENCY_ISSUE | Upstream cause, with attribution | +0.6 if edge verified |
|
| 97 |
+
| ADD_COMMENT | Explanatory comment | +0.3 if keyword match |
|
| 98 |
+
| REQUEST_CONTEXT | Fetch neighbor code | -0.1 (investigation cost) |
|
| 99 |
+
| REQUEST_CHANGES | End review — changes needed | +0.2 if issues found |
|
| 100 |
+
| APPROVE | End review — approved | -1.0 if issues missed |
|
| 101 |
+
|
| 102 |
+
## Baseline Scores (sample_project)
|
| 103 |
+
|
| 104 |
+
| Task | Score | Notes |
|
| 105 |
+
|------|-------|-------|
|
| 106 |
+
| style_review | ~0.80 | Deterministic — pylint flags |
|
| 107 |
+
| logic_review | ~0.55 | Requires null-ref reasoning |
|
| 108 |
+
| cascade_review | ~0.40 | Requires 3-hop attribution |
|
| 109 |
+
|
| 110 |
+
## API Endpoints
|
| 111 |
+
|
| 112 |
+
````
|
| 113 |
+
POST /reset Start new episode
|
| 114 |
+
POST /step Take one action
|
| 115 |
+
GET /state Current graph state
|
| 116 |
+
GET /tasks List available tasks
|
| 117 |
+
GET /health Health check
|
| 118 |
+
POST /reports/generate Generate HTML/JSON/MD report
|
| 119 |
+
````
|
| 120 |
+
|
| 121 |
+
## OpenEnv Compliance
|
| 122 |
+
|
| 123 |
+
- Typed Pydantic models: ReviewAction, CodeObservation, GraphState
|
| 124 |
+
- Full step() / reset() / state() interface
|
| 125 |
+
- openenv.yaml metadata
|
| 126 |
+
- Baseline inference script: inference.py
|
| 127 |
+
- Docker deployment ready
|
code-review-env/env/runtime_config.py
CHANGED
|
@@ -27,11 +27,11 @@ def load_runtime_config() -> RuntimeConfig:
|
|
| 27 |
)
|
| 28 |
return RuntimeConfig(
|
| 29 |
llm_provider=os.getenv("GRAPHREVIEW_LLM_PROVIDER", "ollama_openai_compat"),
|
| 30 |
-
llm_base_url=os.getenv("GRAPHREVIEW_LLM_BASE_URL", "http://localhost:11434/v1"),
|
| 31 |
llm_api_key=os.getenv("GRAPHREVIEW_LLM_API_KEY", "ollama"),
|
| 32 |
-
llm_model_agent=os.getenv("GRAPHREVIEW_LLM_MODEL_AGENT",
|
| 33 |
-
llm_model_training=os.getenv("GRAPHREVIEW_LLM_MODEL_TRAINING",
|
| 34 |
-
llm_model_judge=os.getenv("GRAPHREVIEW_LLM_MODEL_JUDGE", "gemma4:e4b"),
|
| 35 |
llm_model_agent_path=os.getenv("GRAPHREVIEW_QWEN_GGUF_PATH", default_model_path),
|
| 36 |
llm_weight_manifest_dir=os.getenv("GRAPHREVIEW_WEIGHT_MANIFEST_DIR", "outputs/weights"),
|
| 37 |
max_steps_per_episode=int(os.getenv("GRAPHREVIEW_MAX_STEPS_PER_EPISODE", "80")),
|
|
|
|
| 27 |
)
|
| 28 |
return RuntimeConfig(
|
| 29 |
llm_provider=os.getenv("GRAPHREVIEW_LLM_PROVIDER", "ollama_openai_compat"),
|
| 30 |
+
llm_base_url=os.getenv("GRAPHREVIEW_LLM_BASE_URL", os.getenv("API_BASE_URL", "http://localhost:11434/v1")),
|
| 31 |
llm_api_key=os.getenv("GRAPHREVIEW_LLM_API_KEY", "ollama"),
|
| 32 |
+
llm_model_agent=os.getenv("GRAPHREVIEW_LLM_MODEL_AGENT", os.getenv("MODEL_NAME", "gemma4:e4b")),
|
| 33 |
+
llm_model_training=os.getenv("GRAPHREVIEW_LLM_MODEL_TRAINING", os.getenv("MODEL_NAME", "gemma4:e4b")),
|
| 34 |
+
llm_model_judge=os.getenv("GRAPHREVIEW_LLM_MODEL_JUDGE", os.getenv("MODEL_NAME", "gemma4:e4b")),
|
| 35 |
llm_model_agent_path=os.getenv("GRAPHREVIEW_QWEN_GGUF_PATH", default_model_path),
|
| 36 |
llm_weight_manifest_dir=os.getenv("GRAPHREVIEW_WEIGHT_MANIFEST_DIR", "outputs/weights"),
|
| 37 |
max_steps_per_episode=int(os.getenv("GRAPHREVIEW_MAX_STEPS_PER_EPISODE", "80")),
|
code-review-env/graders/hard_grader.py
CHANGED
|
@@ -11,6 +11,9 @@ from graders.base_grader import EpisodeState
|
|
| 11 |
from graders.medium_grader import MediumGrader
|
| 12 |
|
| 13 |
|
|
|
|
|
|
|
|
|
|
| 14 |
class HardGrader(MediumGrader):
|
| 15 |
"""Deterministic semgrep plus dependency graph attribution grading."""
|
| 16 |
|
|
@@ -22,7 +25,9 @@ class HardGrader(MediumGrader):
|
|
| 22 |
def truth_analyzers(self) -> set[str] | None:
|
| 23 |
raw = os.getenv("GRAPHREVIEW_HARD_TRUTH_ANALYZERS", "semgrep,bandit,pyright,mypy")
|
| 24 |
analyzers = {item.strip() for item in raw.split(",") if item.strip()}
|
| 25 |
-
|
|
|
|
|
|
|
| 26 |
|
| 27 |
def grade_action(
|
| 28 |
self,
|
|
@@ -83,7 +88,7 @@ class HardGrader(MediumGrader):
|
|
| 83 |
findings: list[AnalyzerFinding],
|
| 84 |
state: EpisodeState,
|
| 85 |
) -> AnalyzerFinding | None:
|
| 86 |
-
allowed = self.truth_analyzers() or
|
| 87 |
for finding in findings:
|
| 88 |
finding_id = finding.id or -1
|
| 89 |
if finding_id in state.matched_finding_ids:
|
|
|
|
| 11 |
from graders.medium_grader import MediumGrader
|
| 12 |
|
| 13 |
|
| 14 |
+
SEMGREP_ENABLED = os.getenv("GRAPHREVIEW_SEMGREP_ENABLED", "false").lower() == "true"
|
| 15 |
+
|
| 16 |
+
|
| 17 |
class HardGrader(MediumGrader):
|
| 18 |
"""Deterministic semgrep plus dependency graph attribution grading."""
|
| 19 |
|
|
|
|
| 25 |
def truth_analyzers(self) -> set[str] | None:
|
| 26 |
raw = os.getenv("GRAPHREVIEW_HARD_TRUTH_ANALYZERS", "semgrep,bandit,pyright,mypy")
|
| 27 |
analyzers = {item.strip() for item in raw.split(",") if item.strip()}
|
| 28 |
+
if not SEMGREP_ENABLED:
|
| 29 |
+
analyzers.discard("semgrep")
|
| 30 |
+
return analyzers
|
| 31 |
|
| 32 |
def grade_action(
|
| 33 |
self,
|
|
|
|
| 88 |
findings: list[AnalyzerFinding],
|
| 89 |
state: EpisodeState,
|
| 90 |
) -> AnalyzerFinding | None:
|
| 91 |
+
allowed = self.truth_analyzers() or set()
|
| 92 |
for finding in findings:
|
| 93 |
finding_id = finding.id or -1
|
| 94 |
if finding_id in state.matched_finding_ids:
|
code-review-env/inference.py
CHANGED
|
@@ -166,6 +166,7 @@ def _extract_agent_findings(store: Store, config) -> set[str]:
|
|
| 166 |
def main() -> None:
|
| 167 |
args = _build_parser().parse_args()
|
| 168 |
config = load_runtime_config()
|
|
|
|
| 169 |
|
| 170 |
target = Path(args.target).resolve()
|
| 171 |
print(f"[START] target={target} model={config.llm_model_training} mode=deterministic-ground-truth")
|
|
@@ -173,7 +174,7 @@ def main() -> None:
|
|
| 173 |
weight_manager = WeightSafetyManager(Path(config.llm_weight_manifest_dir))
|
| 174 |
if args.register_weights:
|
| 175 |
manifest = weight_manager.register_existing(
|
| 176 |
-
model_name=
|
| 177 |
weight_path=Path(config.llm_model_agent_path),
|
| 178 |
)
|
| 179 |
print(
|
|
@@ -189,10 +190,10 @@ def main() -> None:
|
|
| 189 |
)
|
| 190 |
|
| 191 |
try:
|
| 192 |
-
verified_weight_path = weight_manager.load_verified(
|
| 193 |
except FileNotFoundError:
|
| 194 |
manifest = weight_manager.register_existing(
|
| 195 |
-
model_name=
|
| 196 |
weight_path=Path(config.llm_model_agent_path),
|
| 197 |
)
|
| 198 |
print(
|
|
@@ -206,7 +207,7 @@ def main() -> None:
|
|
| 206 |
sort_keys=True,
|
| 207 |
)
|
| 208 |
)
|
| 209 |
-
verified_weight_path = weight_manager.load_verified(
|
| 210 |
print(f"[STEP] weights_verified path={verified_weight_path}")
|
| 211 |
|
| 212 |
seed_result = seed_project(target_dir=target, db_path=args.db_path, force=args.force_seed)
|
|
|
|
| 166 |
def main() -> None:
|
| 167 |
args = _build_parser().parse_args()
|
| 168 |
config = load_runtime_config()
|
| 169 |
+
model_name = os.getenv("MODEL_NAME", "gemma4:e4b")
|
| 170 |
|
| 171 |
target = Path(args.target).resolve()
|
| 172 |
print(f"[START] target={target} model={config.llm_model_training} mode=deterministic-ground-truth")
|
|
|
|
| 174 |
weight_manager = WeightSafetyManager(Path(config.llm_weight_manifest_dir))
|
| 175 |
if args.register_weights:
|
| 176 |
manifest = weight_manager.register_existing(
|
| 177 |
+
model_name=model_name,
|
| 178 |
weight_path=Path(config.llm_model_agent_path),
|
| 179 |
)
|
| 180 |
print(
|
|
|
|
| 190 |
)
|
| 191 |
|
| 192 |
try:
|
| 193 |
+
verified_weight_path = weight_manager.load_verified(model_name)
|
| 194 |
except FileNotFoundError:
|
| 195 |
manifest = weight_manager.register_existing(
|
| 196 |
+
model_name=model_name,
|
| 197 |
weight_path=Path(config.llm_model_agent_path),
|
| 198 |
)
|
| 199 |
print(
|
|
|
|
| 207 |
sort_keys=True,
|
| 208 |
)
|
| 209 |
)
|
| 210 |
+
verified_weight_path = weight_manager.load_verified(model_name)
|
| 211 |
print(f"[STEP] weights_verified path={verified_weight_path}")
|
| 212 |
|
| 213 |
seed_result = seed_project(target_dir=target, db_path=args.db_path, force=args.force_seed)
|
code-review-env/outputs/training/deterministic_findings.jsonl
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"agent_output": "", "deterministic_targets": ["pylint:inventory:C0114:1"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 2 |
+
{"agent_output": "", "deterministic_targets": ["pylint:inventory:C0116:7"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 3 |
+
{"agent_output": "", "deterministic_targets": ["pylint:payments:C0116:6"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 4 |
+
{"agent_output": "", "deterministic_targets": ["pylint:payments:C0116:12"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 5 |
+
{"agent_output": "", "deterministic_targets": ["pylint:utils:C0114:1"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 6 |
+
{"agent_output": "", "deterministic_targets": ["pylint:utils:C0116:4"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 7 |
+
{"agent_output": "", "deterministic_targets": ["pylint:cart:C0116:6"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 8 |
+
{"agent_output": "", "deterministic_targets": ["pylint:cart:C0116:13"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 9 |
+
{"agent_output": "", "deterministic_targets": ["pylint:auth:C0301:7"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 10 |
+
{"agent_output": "", "deterministic_targets": ["pylint:auth:C0116:6"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 11 |
+
{"agent_output": "", "deterministic_targets": ["pylint:checkout:C0116:7"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 12 |
+
{"agent_output": "", "deterministic_targets": ["pylint:database:C0114:1"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 13 |
+
{"agent_output": "", "deterministic_targets": ["pylint:database:E0611:1"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 14 |
+
{"agent_output": "", "deterministic_targets": ["pylint:database:C0116:4"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 15 |
+
{"agent_output": "", "deterministic_targets": ["pylint:validators:C0114:1"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 16 |
+
{"agent_output": "", "deterministic_targets": ["pylint:validators:C0116:2"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 17 |
+
{"agent_output": "", "deterministic_targets": ["pylint:validators:C0116:6"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 18 |
+
{"agent_output": "", "deterministic_targets": ["pylint:notifications:C0114:1"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 19 |
+
{"agent_output": "", "deterministic_targets": ["pylint:notifications:C0116:4"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 20 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:4"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 21 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:438"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 22 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:442"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 23 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0115:446"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 24 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:447"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 25 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:R0903:446"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 26 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:451"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 27 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:455"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 28 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:459"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 29 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:463"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 30 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:467"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 31 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:471"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 32 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:475"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 33 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:479"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 34 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:483"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 35 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:487"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 36 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:491"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 37 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:495"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 38 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:499"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 39 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:503"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 40 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:507"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 41 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:511"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 42 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:515"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 43 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:519"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 44 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:523"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 45 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:527"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 46 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:531"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 47 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:535"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 48 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:539"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 49 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:543"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 50 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:547"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 51 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:551"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 52 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:555"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 53 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:559"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 54 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:563"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 55 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:567"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 56 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:571"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 57 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:575"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 58 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:579"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 59 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:583"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 60 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:587"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 61 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:591"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 62 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:595"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 63 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:599"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 64 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:603"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 65 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:607"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 66 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:611"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 67 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:615"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 68 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:619"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 69 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:623"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 70 |
+
{"agent_output": "", "deterministic_targets": ["pylint:huge_module:C0116:627"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 71 |
+
{"agent_output": "", "deterministic_targets": ["bandit:config:B105:6"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 72 |
+
{"agent_output": "", "deterministic_targets": ["bandit:payments:B404:3"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
| 73 |
+
{"agent_output": "", "deterministic_targets": ["bandit:payments:B602:9"], "prompt": "Review the module and detect concrete bugs, security issues, and dependency-attributed cascade problems without relying on prior findings.", "reward": 0.0}
|
code-review-env/outputs/weights/hf.coQwenQwen2.5-Coder-7B-Instruct-GGUFlatest.manifest.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"created_at": "2026-04-08T14:18:51.241708+00:00",
|
| 3 |
+
"model_name": "hf.co/Qwen/Qwen2.5-Coder-7B-Instruct-GGUF:latest",
|
| 4 |
+
"sha256": "509287f78cb4d4cf6b3843734733b914b2c158e43e22a7f4bf5e963800894d3c",
|
| 5 |
+
"size_bytes": 4683073536,
|
| 6 |
+
"source_path": "/usr/share/ollama/.ollama/models/blobs/sha256-509287f78cb4d4cf6b3843734733b914b2c158e43e22a7f4bf5e963800894d3c"
|
| 7 |
+
}
|
code-review-env/server/app.py
CHANGED
|
@@ -677,7 +677,7 @@ def run_deterministic_analysis(payload: AnalyzerRunRequest) -> AnalyzerRunRespon
|
|
| 677 |
def bootstrap_training() -> TrainingBootstrapResponse:
|
| 678 |
config = load_runtime_config()
|
| 679 |
weight_manager = WeightSafetyManager(Path(config.llm_weight_manifest_dir))
|
| 680 |
-
model_name =
|
| 681 |
try:
|
| 682 |
weight_path = weight_manager.load_verified(model_name)
|
| 683 |
sha256 = weight_manager.checksum(weight_path)
|
|
|
|
| 677 |
def bootstrap_training() -> TrainingBootstrapResponse:
|
| 678 |
config = load_runtime_config()
|
| 679 |
weight_manager = WeightSafetyManager(Path(config.llm_weight_manifest_dir))
|
| 680 |
+
model_name = os.getenv("MODEL_NAME", "gemma4:e4b")
|
| 681 |
try:
|
| 682 |
weight_path = weight_manager.load_verified(model_name)
|
| 683 |
sha256 = weight_manager.checksum(weight_path)
|