fix: score source-reviewed findings without judge API calls
Browse files- reviewbench/README.md +10 -2
- reviewbench/adapter/review-inputs.mjs +14 -4
- reviewbench/finish.py +13 -16
- reviewbench/manifest.json +6 -5
- reviewbench/models.json +0 -1
- reviewbench/run.py +2 -2
- reviewbench/score_judgments.mjs +51 -0
reviewbench/README.md
CHANGED
|
@@ -14,7 +14,7 @@ Native answers, file answers, explanation responses and coverage are saved per P
|
|
| 14 |
|
| 15 |
Clone the pinned Perch and ReviewBench revisions in `manifest.json` into `perch/` and `upstream/`. Install ReviewBench's dependencies with `npm ci` in `upstream/`.
|
| 16 |
|
| 17 |
-
Export `OPENAI_API_KEY` for Luna and explanations, `TYPESAFE_API_KEY` for Jev
|
| 18 |
|
| 19 |
```sh
|
| 20 |
docker build --platform linux/amd64 --build-arg PERCH_COMMIT=$(git -C perch rev-parse HEAD) -t perch-reviewbench:review -f adapter/Dockerfile .
|
|
@@ -33,6 +33,14 @@ python finish.py --run luna --model gpt-6-luna --workers 2
|
|
| 33 |
python finish.py --run jev --model jev-latest --workers 2
|
| 34 |
```
|
| 35 |
|
| 36 |
-
`finish.py` completes the review collection
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
Official leaderboard submissions go through the [ReviewBench portal](https://review-bench.ai/submit).
|
|
|
|
| 14 |
|
| 15 |
Clone the pinned Perch and ReviewBench revisions in `manifest.json` into `perch/` and `upstream/`. Install ReviewBench's dependencies with `npm ci` in `upstream/`.
|
| 16 |
|
| 17 |
+
Export `OPENAI_API_KEY` for Luna and explanations, `TYPESAFE_API_KEY` for Jev.
|
| 18 |
|
| 19 |
```sh
|
| 20 |
docker build --platform linux/amd64 --build-arg PERCH_COMMIT=$(git -C perch rev-parse HEAD) -t perch-reviewbench:review -f adapter/Dockerfile .
|
|
|
|
| 33 |
python finish.py --run jev --model jev-latest --workers 2
|
| 34 |
```
|
| 35 |
|
| 36 |
+
`finish.py` completes the review collection without calling a judge API. Findings are judged against the saved source revision and reference issues. A match must identify the same underlying issue; a file or line overlap alone does not count. Unsupported claims are false positives. The reference labels stay unchanged.
|
| 37 |
+
|
| 38 |
+
Source-review annotations identify the candidate index, TP/FP label, matching reference indices, severity, category and reasoning. They include SHA-256 hashes of both inputs and the source revision. `score_judgments.mjs` validates these annotations and uses ReviewBench's scoring functions without model calls:
|
| 39 |
+
|
| 40 |
+
```sh
|
| 41 |
+
node --import ./upstream/node_modules/tsx/dist/loader.mjs score_judgments.mjs luna judgments/luna upstream
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
The score includes only fully judged PRs and states whether all 219 have been judged. Codex judgments are identified separately from official leaderboard judging.
|
| 45 |
|
| 46 |
Official leaderboard submissions go through the [ReviewBench portal](https://review-bench.ai/submit).
|
reviewbench/adapter/review-inputs.mjs
CHANGED
|
@@ -7,9 +7,16 @@ import { listTree, openBlobReader } from '/opt/perch/src/git.js';
|
|
| 7 |
import { sourceChunks } from '/opt/perch/src/chunks.js';
|
| 8 |
import { createSystemOne } from '/opt/perch/src/systemone.js';
|
| 9 |
import { createMeter, metered } from '/opt/perch/src/meter.js';
|
| 10 |
-
import { withTokenRetries } from '/opt/perch/src/tokens.js';
|
| 11 |
import { FILE_QUESTIONS, fileFindings } from './review-questions.mjs';
|
| 12 |
const exec = promisify(execFile);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
export const numbered = (source, first = 1) => source.split('\n').map((line, index) => `L${first + index}| ${line}`).join('\n');
|
| 14 |
export async function mapParallel(items, parallel, work) {
|
| 15 |
let next = 0;
|
|
@@ -58,11 +65,14 @@ export async function reviewInputs({ repo, revision, base, scan, out, producer,
|
|
| 58 |
const chunks = sourceChunks(source, { path, maxTokens: Math.max(128, Math.floor(budget / 3)) });
|
| 59 |
const flags = [];
|
| 60 |
for (const chunk of chunks) {
|
| 61 |
-
const
|
| 62 |
-
|
|
|
|
|
|
|
|
|
|
| 63 |
reading: { start_byte: chunk.startByte, end_byte: chunk.endByte, partial: chunks.length > 1 } };
|
| 64 |
// Keep the diff bounded separately; it is PR context, not a substitute for the complete chunked source.
|
| 65 |
-
if (diff)
|
| 66 |
const reply = await client.ask(state, FILE_QUESTIONS);
|
| 67 |
const found = fileFindings(reply.answers, { path, line: chunk.line, endLine: chunk.endLine }, producer);
|
| 68 |
flags.push(...found);
|
|
|
|
| 7 |
import { sourceChunks } from '/opt/perch/src/chunks.js';
|
| 8 |
import { createSystemOne } from '/opt/perch/src/systemone.js';
|
| 9 |
import { createMeter, metered } from '/opt/perch/src/meter.js';
|
| 10 |
+
import { withTokenRetries, textTokens } from '/opt/perch/src/tokens.js';
|
| 11 |
import { FILE_QUESTIONS, fileFindings } from './review-questions.mjs';
|
| 12 |
const exec = promisify(execFile);
|
| 13 |
+
function bounded(text, budget) {
|
| 14 |
+
if (textTokens(text) <= budget) return { text, partial: false };
|
| 15 |
+
let low = 0, high = text.length;
|
| 16 |
+
while (low < high) { const mid = Math.ceil((low + high) / 2); if (textTokens(text.slice(0, mid)) <= budget) low = mid; else high = mid - 1; }
|
| 17 |
+
if (low && /[\uD800-\uDBFF]/.test(text[low - 1])) low--;
|
| 18 |
+
return { text: text.slice(0, low), partial: true };
|
| 19 |
+
}
|
| 20 |
export const numbered = (source, first = 1) => source.split('\n').map((line, index) => `L${first + index}| ${line}`).join('\n');
|
| 21 |
export async function mapParallel(items, parallel, work) {
|
| 22 |
let next = 0;
|
|
|
|
| 65 |
const chunks = sourceChunks(source, { path, maxTokens: Math.max(128, Math.floor(budget / 3)) });
|
| 66 |
const flags = [];
|
| 67 |
for (const chunk of chunks) {
|
| 68 |
+
const title = bounded(metadata.title ?? '', Math.max(16, Math.floor(budget / 32)));
|
| 69 |
+
const body = bounded(metadata.body ?? '', Math.max(16, Math.floor(budget / 8)));
|
| 70 |
+
const shown = evidence.map(item => { const limited = bounded(item.source, Math.max(16, Math.floor(budget / 64))); return { path: item.path, source: limited.text, partial: limited.partial }; });
|
| 71 |
+
const state = { pr: { title: title.text, body: body.text, partial: title.partial || body.partial }, file: { path, source: numbered(chunk.source, chunk.line) },
|
| 72 |
+
imports: (fileRecord?.imports ?? []).slice(0, 20), related: shown,
|
| 73 |
reading: { start_byte: chunk.startByte, end_byte: chunk.endByte, partial: chunks.length > 1 } };
|
| 74 |
// Keep the diff bounded separately; it is PR context, not a substitute for the complete chunked source.
|
| 75 |
+
if (diff) { const change = bounded(diff, Math.max(16, Math.floor(budget / 12))); state.change = { source: change.text, partial: change.partial }; }
|
| 76 |
const reply = await client.ask(state, FILE_QUESTIONS);
|
| 77 |
const found = fileFindings(reply.answers, { path, line: chunk.line, endLine: chunk.endLine }, producer);
|
| 78 |
flags.push(...found);
|
reviewbench/finish.py
CHANGED
|
@@ -1,27 +1,24 @@
|
|
| 1 |
-
"""
|
| 2 |
-
import argparse,json,
|
| 3 |
from pathlib import Path
|
| 4 |
ROOT=Path(__file__).resolve().parent
|
| 5 |
|
| 6 |
def main():
|
| 7 |
-
|
| 8 |
-
run=
|
|
|
|
|
|
|
|
|
|
| 9 |
for _ in range(3):
|
| 10 |
-
code=subprocess.run([sys.executable,str(ROOT/'run.py'),'--set','full','--run',args.run,'--image',args.image,'--workers',str(args.workers),'--model',args.model]
|
| 11 |
if code==0:break
|
| 12 |
if code:raise SystemExit(code)
|
| 13 |
status=json.loads((run/'status.json').read_text())
|
| 14 |
if status['completed']!=219 or status['failed']:raise RuntimeError('Review coverage is incomplete')
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
if result['pr_count']!=219:raise RuntimeError('Judge coverage is incomplete')
|
| 21 |
-
for average in ['micro','macro']:
|
| 22 |
-
metrics=result[average]['overall']
|
| 23 |
-
for kind in ['grounded','augmented']:
|
| 24 |
-
p=metrics[kind+'_precision'];r=metrics[kind+'_recall'];metrics[kind+'_f1']=2*p*r/(p+r) if p is not None and r is not None and p+r else 0
|
| 25 |
-
(run/'summary.json').write_text(json.dumps({'prs':219,'micro':result['micro']['overall'],'macro':result['macro']['overall'],'candidate_usage':result['candidate_usage']},indent=2))
|
| 26 |
|
| 27 |
if __name__=='__main__':main()
|
|
|
|
| 1 |
+
"""Complete reviews and optionally aggregate supplied judgments, without paid judge calls."""
|
| 2 |
+
import argparse,json,subprocess,sys
|
| 3 |
from pathlib import Path
|
| 4 |
ROOT=Path(__file__).resolve().parent
|
| 5 |
|
| 6 |
def main():
|
| 7 |
+
p=argparse.ArgumentParser()
|
| 8 |
+
p.add_argument('--run',default='run');p.add_argument('--image',default='perch-reviewbench:review')
|
| 9 |
+
p.add_argument('--workers',type=int,default=2);p.add_argument('--model',choices=['jev-latest','gpt-6-luna'],default='gpt-6-luna')
|
| 10 |
+
p.add_argument('--judgments',type=Path)
|
| 11 |
+
args=p.parse_args();run=ROOT/args.run
|
| 12 |
for _ in range(3):
|
| 13 |
+
code=subprocess.run([sys.executable,str(ROOT/'run.py'),'--set','full','--run',args.run,'--image',args.image,'--workers',str(args.workers),'--model',args.model]).returncode
|
| 14 |
if code==0:break
|
| 15 |
if code:raise SystemExit(code)
|
| 16 |
status=json.loads((run/'status.json').read_text())
|
| 17 |
if status['completed']!=219 or status['failed']:raise RuntimeError('Review coverage is incomplete')
|
| 18 |
+
if args.judgments:
|
| 19 |
+
tsx=ROOT/'upstream/node_modules/tsx/dist/loader.mjs'
|
| 20 |
+
subprocess.run(['node','--import',str(tsx),str(ROOT/'score_judgments.mjs'),str(run),str(args.judgments),str(ROOT/'upstream')],check=True)
|
| 21 |
+
else:
|
| 22 |
+
print('All 219 reviews are saved. Ready for source review; no judge API was called.')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
if __name__=='__main__':main()
|
reviewbench/manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
{
|
| 2 |
"reviewbench_commit": "c17b05be9c90b85a1fc012ce39e455e2d09a7255",
|
| 3 |
-
"perch_commit": "
|
| 4 |
-
"image": "sha256:
|
| 5 |
"protocol": "perch-review-inputs-explained",
|
| 6 |
"models": [
|
| 7 |
"jev-latest",
|
|
@@ -17,7 +17,8 @@
|
|
| 17 |
"design": 60,
|
| 18 |
"security": 70
|
| 19 |
},
|
| 20 |
-
"judge": "
|
| 21 |
"reference_labels_available_to_review": false,
|
| 22 |
-
"explanation_effort": "low"
|
| 23 |
-
|
|
|
|
|
|
| 1 |
{
|
| 2 |
"reviewbench_commit": "c17b05be9c90b85a1fc012ce39e455e2d09a7255",
|
| 3 |
+
"perch_commit": "67575f846d2b0c1d912fea8e0f0e9ba8941c4a24",
|
| 4 |
+
"image": "sha256:e73b739057ed778d3095dd9a6cadce676042def6ad3222e7e28c74555e252266",
|
| 5 |
"protocol": "perch-review-inputs-explained",
|
| 6 |
"models": [
|
| 7 |
"jev-latest",
|
|
|
|
| 17 |
"design": 60,
|
| 18 |
"security": 70
|
| 19 |
},
|
| 20 |
+
"judge": "Codex source review",
|
| 21 |
"reference_labels_available_to_review": false,
|
| 22 |
+
"explanation_effort": "low",
|
| 23 |
+
"automatic_judge_api": false
|
| 24 |
+
}
|
reviewbench/models.json
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
{"providers": {"openrouter": {"baseUrl": "https://openrouter.ai/api/v1", "api": "openai-completions", "apiKey": "OPENROUTER_API_KEY", "models": [{"id": "anthropic/claude-sonnet-5", "reasoning": true, "contextWindow": 1000000, "maxTokens": 8192, "cost": {"input": 2, "output": 10, "cacheRead": 0.2, "cacheWrite": 2.5}}]}}}
|
|
|
|
|
|
reviewbench/run.py
CHANGED
|
@@ -39,7 +39,7 @@ def main():
|
|
| 39 |
if cached.exists() and not destination.exists():
|
| 40 |
destination.parent.mkdir(parents=True,exist_ok=True)
|
| 41 |
subprocess.run(['git','clone','--local','--quiet',str(cached),str(destination)],env=env,check=True)
|
| 42 |
-
cmd=[str(ROOT/'upstream/scripts/try-agent.sh'),args.image,'--set',args.set,'--pr',str(i),'-e','TYPESAFE_API_KEY','-e','OPENAI_API_KEY','-e',f'RB_IMAGE_ID={image_id}','-e','RB_AGENT=perch','-e',f'RB_CONFIG_MODEL={args.model}','-e','RB_CONFIG_SCAN_TYPES=defect,security,refactor,docs']
|
| 43 |
captured=taskwork/'captured';prior=taskwork/'out'/key
|
| 44 |
if args.resume_explanations:
|
| 45 |
# Keep the original paid native and file answers; only regenerate descriptions.
|
|
@@ -53,7 +53,7 @@ def main():
|
|
| 53 |
# try-agent accepts environment but not an extra mount; replay uses the exact existing input checkout directly.
|
| 54 |
pr=taskwork/'pr'/key;newout=taskwork/'out'/key;newout.mkdir(parents=True,exist_ok=True)
|
| 55 |
cmd=['docker','run','--rm','--platform','linux/amd64','-v',str(destination)+':/work/repo:ro','-v',str(pr)+':/work/pr:ro','-v',str(newout)+':/work/out','-v',str(captured)+':/work/captured:ro',
|
| 56 |
-
'-e','GIT_CONFIG_COUNT=1','-e','GIT_CONFIG_KEY_0=safe.directory','-e','GIT_CONFIG_VALUE_0=*','-e','OPENAI_API_KEY','-e','TYPESAFE_API_KEY',
|
| 57 |
'-e',f'RB_NWO={t["nwo"]}','-e',f'RB_PR_NUMBER={t["pr_number"]}','-e',f'RB_BASE={t["base"]}','-e',f'RB_HEAD={t["head"]}',
|
| 58 |
'-e','RB_REPO=/work/repo','-e','RB_PR_JSON=/work/pr/pr.json','-e','RB_OUT=/work/out/findings.json','-e','RB_AGENT=perch','-e',f'RB_IMAGE_ID={image_id}','-e',f'RB_CONFIG_MODEL={args.model}','-e','RB_CAPTURED_OUT=/work/captured',args.image]
|
| 59 |
if output.exists(): output.unlink()
|
|
|
|
| 39 |
if cached.exists() and not destination.exists():
|
| 40 |
destination.parent.mkdir(parents=True,exist_ok=True)
|
| 41 |
subprocess.run(['git','clone','--local','--quiet',str(cached),str(destination)],env=env,check=True)
|
| 42 |
+
cmd=[str(ROOT/'upstream/scripts/try-agent.sh'),args.image,'--set',args.set,'--pr',str(i),'-e','NODE_OPTIONS=--max-old-space-size=16384','-e','TYPESAFE_API_KEY','-e','OPENAI_API_KEY','-e',f'RB_IMAGE_ID={image_id}','-e','RB_AGENT=perch','-e',f'RB_CONFIG_MODEL={args.model}','-e','RB_CONFIG_SCAN_TYPES=defect,security,refactor,docs']
|
| 43 |
captured=taskwork/'captured';prior=taskwork/'out'/key
|
| 44 |
if args.resume_explanations:
|
| 45 |
# Keep the original paid native and file answers; only regenerate descriptions.
|
|
|
|
| 53 |
# try-agent accepts environment but not an extra mount; replay uses the exact existing input checkout directly.
|
| 54 |
pr=taskwork/'pr'/key;newout=taskwork/'out'/key;newout.mkdir(parents=True,exist_ok=True)
|
| 55 |
cmd=['docker','run','--rm','--platform','linux/amd64','-v',str(destination)+':/work/repo:ro','-v',str(pr)+':/work/pr:ro','-v',str(newout)+':/work/out','-v',str(captured)+':/work/captured:ro',
|
| 56 |
+
'-e','GIT_CONFIG_COUNT=1','-e','GIT_CONFIG_KEY_0=safe.directory','-e','GIT_CONFIG_VALUE_0=*','-e','OPENAI_API_KEY','-e','TYPESAFE_API_KEY','-e','NODE_OPTIONS=--max-old-space-size=16384',
|
| 57 |
'-e',f'RB_NWO={t["nwo"]}','-e',f'RB_PR_NUMBER={t["pr_number"]}','-e',f'RB_BASE={t["base"]}','-e',f'RB_HEAD={t["head"]}',
|
| 58 |
'-e','RB_REPO=/work/repo','-e','RB_PR_JSON=/work/pr/pr.json','-e','RB_OUT=/work/out/findings.json','-e','RB_AGENT=perch','-e',f'RB_IMAGE_ID={image_id}','-e',f'RB_CONFIG_MODEL={args.model}','-e','RB_CAPTURED_OUT=/work/captured',args.image]
|
| 59 |
if output.exists(): output.unlink()
|
reviewbench/score_judgments.mjs
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Aggregate supplied source-reviewed judgments. This program makes no API calls.
|
| 2 |
+
import { readFile, readdir, mkdir, writeFile } from 'node:fs/promises';
|
| 3 |
+
import { createHash } from 'node:crypto';
|
| 4 |
+
import { resolve, join } from 'node:path';
|
| 5 |
+
import { pathToFileURL } from 'node:url';
|
| 6 |
+
const [runArg, judgmentsArg, upstreamArg = 'upstream'] = process.argv.slice(2);
|
| 7 |
+
if (!runArg || !judgmentsArg) throw new Error('Usage: score_judgments.mjs RUN JUDGMENTS [UPSTREAM]');
|
| 8 |
+
const run = resolve(runArg), dir = resolve(judgmentsArg), upstream = resolve(upstreamArg);
|
| 9 |
+
const { scorePR, aggregate } = await import(pathToFileURL(join(upstream, 'scripts/eval/scorer.ts')));
|
| 10 |
+
const { resolveForScoring } = await import(pathToFileURL(join(upstream, 'scripts/lib/match-types.ts')));
|
| 11 |
+
const hash = bytes => createHash('sha256').update(bytes).digest('hex');
|
| 12 |
+
const scores = [], judging = [], direct = { tp: 0, fp: 0, golden_tp: 0, covered_golden_tp: 0 };
|
| 13 |
+
for (const file of (await readdir(dir)).filter(f => f.endsWith('.json')).sort()) {
|
| 14 |
+
const annotation = JSON.parse(await readFile(join(dir, file), 'utf8'));
|
| 15 |
+
const cbytes = await readFile(join(run, 'findings', file));
|
| 16 |
+
const gbytes = await readFile(join(upstream, 'golden', file));
|
| 17 |
+
if (hash(cbytes) !== annotation.candidate_sha256 || hash(gbytes) !== annotation.golden_sha256) {
|
| 18 |
+
throw new Error(`${file}: judgments refer to a different candidate or reference snapshot; review again`);
|
| 19 |
+
}
|
| 20 |
+
const candidate = JSON.parse(cbytes), golden = JSON.parse(gbytes);
|
| 21 |
+
if (candidate.pr.head !== annotation.head || golden.pr.head !== annotation.head) throw new Error(`${file}: revision mismatch`);
|
| 22 |
+
const rows = annotation.findings;
|
| 23 |
+
if (rows.length !== candidate.findings.length) throw new Error(`${file}: incomplete judgments`);
|
| 24 |
+
const classifications = new Map();
|
| 25 |
+
const raw = rows.map((row, i) => {
|
| 26 |
+
if (row.candidate_index !== i || !['tp', 'fp'].includes(row.tp_fp) || !row.reason) throw new Error(`${file}: invalid judgment ${i}`);
|
| 27 |
+
for (const index of row.matched_golden_indices) {
|
| 28 |
+
if (!Number.isInteger(index) || index < 0 || index >= golden.findings.length) throw new Error(`${file}: invalid reference index`);
|
| 29 |
+
if (candidate.findings[i].file !== golden.findings[index].file) throw new Error(`${file}: cross-file match`);
|
| 30 |
+
}
|
| 31 |
+
classifications.set(i, { ...candidate.findings[i], tp_fp: row.tp_fp, severity: row.severity, category: row.category, tp_fp_justification: row.reason });
|
| 32 |
+
direct[row.tp_fp]++;
|
| 33 |
+
return { candidate_index: i, matched_golden_indices: row.matched_golden_indices };
|
| 34 |
+
});
|
| 35 |
+
const scoring = resolveForScoring(raw, golden.findings.length);
|
| 36 |
+
scores.push(scorePR({ pr_key: annotation.pr_key, golden: golden.findings, candidate_count: candidate.findings.length,
|
| 37 |
+
matched: scoring.matchedToGolden, unmatched: scoring.unmatched, covered_golden: scoring.coveredGolden,
|
| 38 |
+
unmatched_classifications: new Map([...scoring.unmatched].map(i => [i, classifications.get(i)])) }));
|
| 39 |
+
golden.findings.forEach((g, i) => { if (g.tp_fp === 'tp') { direct.golden_tp++; if (scoring.coveredGolden.has(i)) direct.covered_golden_tp++; } });
|
| 40 |
+
judging.push({ pr_key: annotation.pr_key, judge: annotation.judge, candidate_sha256: annotation.candidate_sha256 });
|
| 41 |
+
}
|
| 42 |
+
if (!scores.length) throw new Error('No completed source-reviewed PR judgments');
|
| 43 |
+
const result = aggregate(scores);
|
| 44 |
+
result.judging = judging;
|
| 45 |
+
result.direct_source_review = { ...direct, false_negatives: direct.golden_tp - direct.covered_golden_tp,
|
| 46 |
+
precision: direct.tp + direct.fp ? direct.tp / (direct.tp + direct.fp) : null,
|
| 47 |
+
recall: direct.golden_tp ? direct.covered_golden_tp / direct.golden_tp : null };
|
| 48 |
+
result.judge = 'Codex'; result.complete_benchmark = result.pr_count === 219;
|
| 49 |
+
await mkdir(join(run, 'codex-scoring'), { recursive: true });
|
| 50 |
+
await writeFile(join(run, 'codex-scoring/results.json'), JSON.stringify(result, null, 2) + '\n');
|
| 51 |
+
console.log(JSON.stringify({ run, judged_prs: result.pr_count, complete_benchmark: result.complete_benchmark, ...result.direct_source_review }));
|