evalbuff 0.0.1
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.
- package/README.md +79 -0
- package/dist/carve-features.d.ts +42 -0
- package/dist/carve-features.d.ts.map +1 -0
- package/dist/carve-features.js +305 -0
- package/dist/carve-features.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +42 -0
- package/dist/cli.js.map +1 -0
- package/dist/docs-refactor.d.ts +4 -0
- package/dist/docs-refactor.d.ts.map +1 -0
- package/dist/docs-refactor.js +122 -0
- package/dist/docs-refactor.js.map +1 -0
- package/dist/docs-writer.d.ts +4 -0
- package/dist/docs-writer.d.ts.map +1 -0
- package/dist/docs-writer.js +122 -0
- package/dist/docs-writer.js.map +1 -0
- package/dist/eval-helpers.d.ts +19 -0
- package/dist/eval-helpers.d.ts.map +1 -0
- package/dist/eval-helpers.js +327 -0
- package/dist/eval-helpers.js.map +1 -0
- package/dist/eval-runner.d.ts +42 -0
- package/dist/eval-runner.d.ts.map +1 -0
- package/dist/eval-runner.js +193 -0
- package/dist/eval-runner.js.map +1 -0
- package/dist/judge.d.ts +22 -0
- package/dist/judge.d.ts.map +1 -0
- package/dist/judge.js +284 -0
- package/dist/judge.js.map +1 -0
- package/dist/perfect-feature.d.ts +2 -0
- package/dist/perfect-feature.d.ts.map +1 -0
- package/dist/perfect-feature.js +666 -0
- package/dist/perfect-feature.js.map +1 -0
- package/dist/report.d.ts +31 -0
- package/dist/report.d.ts.map +1 -0
- package/dist/report.js +249 -0
- package/dist/report.js.map +1 -0
- package/dist/run-evalbuff.d.ts +12 -0
- package/dist/run-evalbuff.d.ts.map +1 -0
- package/dist/run-evalbuff.js +383 -0
- package/dist/run-evalbuff.js.map +1 -0
- package/dist/runners/claude.d.ts +10 -0
- package/dist/runners/claude.d.ts.map +1 -0
- package/dist/runners/claude.js +80 -0
- package/dist/runners/claude.js.map +1 -0
- package/dist/runners/codebuff.d.ts +24 -0
- package/dist/runners/codebuff.d.ts.map +1 -0
- package/dist/runners/codebuff.js +88 -0
- package/dist/runners/codebuff.js.map +1 -0
- package/dist/runners/codex.d.ts +8 -0
- package/dist/runners/codex.d.ts.map +1 -0
- package/dist/runners/codex.js +131 -0
- package/dist/runners/codex.js.map +1 -0
- package/dist/runners/index.d.ts +5 -0
- package/dist/runners/index.d.ts.map +1 -0
- package/dist/runners/index.js +4 -0
- package/dist/runners/index.js.map +1 -0
- package/dist/runners/runner.d.ts +11 -0
- package/dist/runners/runner.d.ts.map +1 -0
- package/dist/runners/runner.js +2 -0
- package/dist/runners/runner.js.map +1 -0
- package/dist/test-repo-utils.d.ts +21 -0
- package/dist/test-repo-utils.d.ts.map +1 -0
- package/dist/test-repo-utils.js +109 -0
- package/dist/test-repo-utils.js.map +1 -0
- package/dist/trace-compressor.d.ts +130 -0
- package/dist/trace-compressor.d.ts.map +1 -0
- package/dist/trace-compressor.js +680 -0
- package/dist/trace-compressor.js.map +1 -0
- package/dist/tui/data.d.ts +84 -0
- package/dist/tui/data.d.ts.map +1 -0
- package/dist/tui/data.js +80 -0
- package/dist/tui/data.js.map +1 -0
- package/dist/tui/events.d.ts +86 -0
- package/dist/tui/events.d.ts.map +1 -0
- package/dist/tui/events.js +52 -0
- package/dist/tui/events.js.map +1 -0
- package/dist/vendor/error.d.ts +18 -0
- package/dist/vendor/error.d.ts.map +1 -0
- package/dist/vendor/error.js +64 -0
- package/dist/vendor/error.js.map +1 -0
- package/dist/vendor/print-mode.d.ts +75 -0
- package/dist/vendor/print-mode.d.ts.map +1 -0
- package/dist/vendor/print-mode.js +2 -0
- package/dist/vendor/print-mode.js.map +1 -0
- package/package.json +46 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { execSync } from 'child_process';
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import os from 'os';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import { ClaudeRunner } from './runners/claude';
|
|
6
|
+
import { syncDocsIntoRepo } from './eval-helpers';
|
|
7
|
+
export function collectDocSuggestions(tasks) {
|
|
8
|
+
const sections = [];
|
|
9
|
+
for (const task of tasks) {
|
|
10
|
+
const suggestions = task.judging.docSuggestions;
|
|
11
|
+
if (!suggestions || suggestions.length === 0)
|
|
12
|
+
continue;
|
|
13
|
+
sections.push(`### ${task.featureId} (score: ${task.score.toFixed(1)}/10)\n` +
|
|
14
|
+
suggestions.map((s) => `- ${s}`).join('\n'));
|
|
15
|
+
}
|
|
16
|
+
return sections.join('\n\n');
|
|
17
|
+
}
|
|
18
|
+
export async function runDocsWriterAgent(repoPath, judgeSuggestions, model) {
|
|
19
|
+
console.log(`\n [DocsWriter] Running docs writer agent...`);
|
|
20
|
+
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'evalbuff-docs-'));
|
|
21
|
+
const repoDir = path.join(tempDir, 'repo');
|
|
22
|
+
const prompt = `Read ALL existing documentation (docs/, AGENTS.md, CLAUDE.md), consider the judge suggestions below, and make the documentation as useful as possible for coding agents.
|
|
23
|
+
|
|
24
|
+
## Goal
|
|
25
|
+
|
|
26
|
+
The purpose of these docs is to help a coding agent successfully build NEW features it has never seen before, AND to help reviewers verify that changes actually work. The docs should teach the agent how the project works — its architecture, patterns, conventions, and rules — so it can confidently build anything, not just reconstruct specific existing features. They should also document testing strategies, verification processes, and end-to-end testing approaches that help reviewers evaluate changes beyond just reading the diff.
|
|
27
|
+
|
|
28
|
+
## Judge Suggestions
|
|
29
|
+
|
|
30
|
+
Multiple judge agents reviewed coding agent attempts and identified documentation gaps. Here are their suggestions:
|
|
31
|
+
|
|
32
|
+
${judgeSuggestions || '(No suggestions were made)'}
|
|
33
|
+
|
|
34
|
+
## What to do
|
|
35
|
+
|
|
36
|
+
1. **Extract general patterns** — each judge suggestion reflects a specific failure, but your job is to identify the underlying pattern or convention that would prevent a whole class of similar failures. Ask: "What general rule would help an agent get this right for ANY feature?" Some suggestions are about testing/verification strategies for reviewers — treat those as equally important and document them in the appropriate docs (e.g., docs/testing.md or similar).
|
|
37
|
+
2. **Do NOT reference specific features** — never mention a specific feature, component, or endpoint by name as an example of what to build. Instead, document the pattern it follows. For example, instead of "the UserProfile component fetches data in useEffect", write "components in this project fetch data using useEffect on mount, following the pattern in src/hooks/".
|
|
38
|
+
3. **Document architecture and data flow** — describe how the project is structured, how data flows through it, and where new code should be placed. These are the things an agent building something new needs most.
|
|
39
|
+
4. **Edit existing docs** — when a suggestion maps to an existing doc, make fine-grained edits rather than rewriting from scratch.
|
|
40
|
+
5. **Create new docs** — when a suggestion identifies a missing pattern or convention, create a concise new doc for it.
|
|
41
|
+
6. **Merge overlapping docs** — if multiple suggestions or existing docs cover similar topics, combine them.
|
|
42
|
+
7. **Remove redundancy** — consolidate duplicate advice. Dense, actionable information beats verbose explanations.
|
|
43
|
+
8. **Fix contradictions** — if docs disagree, pick the correct advice and remove the wrong one.
|
|
44
|
+
9. **Prune stale docs** — remove docs that reference files/patterns that no longer exist in the codebase.
|
|
45
|
+
|
|
46
|
+
Rules:
|
|
47
|
+
- ONLY modify files in docs/, AGENTS.md, or CLAUDE.md. Do NOT modify source code.
|
|
48
|
+
- **Do NOT edit AGENTS.md beyond adding new docs to its index.** The only allowed changes to AGENTS.md are: (a) adding/removing entries in the doc index when you create or delete files under docs/, and (b) correcting existing information that is factually wrong. Do NOT add new paragraphs, prose, sections, or explanatory text above or below existing content. Put all new guidance in docs/ files and link to them from the index.
|
|
49
|
+
- It's OK to delete doc files that are redundant or low-value.
|
|
50
|
+
- The goal is a minimal, high-signal set of docs that a coding agent can use to build ANY feature, including ones that don't exist yet.
|
|
51
|
+
- Less is more — 5 great docs are better than 15 mediocre ones.
|
|
52
|
+
- Document patterns, conventions, and architectural rules — not specific feature implementations.
|
|
53
|
+
- Be specific about file paths, directory structure, and conventions — but generic about what gets built.
|
|
54
|
+
|
|
55
|
+
## Docs Must Match Source Code
|
|
56
|
+
|
|
57
|
+
Docs that describe nonexistent code are WORSE than no docs at all — they actively mislead coding agents and cause them to fail.
|
|
58
|
+
|
|
59
|
+
Before writing any doc that references a helper, function, type, or script:
|
|
60
|
+
1. **grep for the exact symbol name** to confirm it exists. If it doesn't exist, DO NOT document it.
|
|
61
|
+
2. **Never document aspirational/future behavior.** Only document what the code does RIGHT NOW.
|
|
62
|
+
3. **If a judge suggestion references a helper that doesn't exist**, document the PATTERN the agent should follow instead — not a fictional API.
|
|
63
|
+
|
|
64
|
+
Wrong: "Use \`captureGitDiff()\` from src/eval-helpers.ts to capture diffs" (if it doesn't exist)
|
|
65
|
+
Right: "Diff capture should use an explicit base SHA recorded before the agent runs" (describes the pattern)
|
|
66
|
+
|
|
67
|
+
## Final Step: Spawn a Critique Sub-Agent
|
|
68
|
+
|
|
69
|
+
Before you finish, you MUST spawn a critique sub-agent via the Task tool (subagent_type: "general-purpose") to review the docs you just wrote or modified. Then apply every valid fix it identifies.
|
|
70
|
+
|
|
71
|
+
Use this exact prompt for the sub-agent:
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
You are a documentation critic. Review every file under docs/, plus AGENTS.md and CLAUDE.md, and report violations of the rules below. For each violation, give the file path, the offending text or line range, and a concrete fix (exact replacement text, the section to remove, or the split to perform).
|
|
75
|
+
|
|
76
|
+
Rules (enforce strictly):
|
|
77
|
+
|
|
78
|
+
1. **No overfitting to a single task.** Docs must describe general patterns, conventions, and architecture that apply to building ANY feature — not one specific task. Flag:
|
|
79
|
+
- Feature-specific function, type, component, endpoint, table, or CLI-subcommand names that only matter for one task and are not shared infrastructure.
|
|
80
|
+
- Examples phrased around one feature ("the UserProfile component fetches data via useEffect") instead of the general pattern ("components in src/components/ fetch data in useEffect on mount").
|
|
81
|
+
- Any symbol reference that does not represent a shared utility, pattern, or architectural boundary used by multiple features.
|
|
82
|
+
The fix is to rewrite the passage as a general rule about the pattern, directory, or convention — or delete it if it does not generalize.
|
|
83
|
+
|
|
84
|
+
2. **No code excerpts unless documenting a common utility or shared pattern.** A code block is only allowed when it shows:
|
|
85
|
+
- The signature or usage of a shared helper multiple features rely on, OR
|
|
86
|
+
- A canonical pattern every agent should copy (error handling, a standard import shape, etc.).
|
|
87
|
+
Flag any code block that shows task-specific implementation details. The fix is to delete the block or replace it with a one-line prose description of the pattern.
|
|
88
|
+
|
|
89
|
+
3. **Individual markdown files must stay focused and reasonably short.** If any single file exceeds roughly 300 lines, OR covers multiple unrelated topics, recommend splitting it into smaller topic-scoped files and specify the split (new filenames + which sections move where). Prefer many small focused docs over one large doc.
|
|
90
|
+
|
|
91
|
+
4. **Docs must match source code.** Before flagging a missing symbol, grep the repo to confirm it does not exist. Flag references to helpers, functions, types, files, or scripts that are not present in the code.
|
|
92
|
+
|
|
93
|
+
Return a numbered list of violations with fixes. If a file is clean, say so. Do not edit any files yourself — only report.
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
After the sub-agent returns, apply every valid fix it identified by editing the doc files directly. If it recommended splitting a long doc, perform the split. Re-read each affected file after fixing to confirm the result. Only then finish.`;
|
|
97
|
+
try {
|
|
98
|
+
execSync(`git clone --no-checkout "${repoPath}" "${repoDir}"`, { stdio: 'ignore' });
|
|
99
|
+
const headSha = execSync('git rev-parse HEAD', {
|
|
100
|
+
cwd: repoPath,
|
|
101
|
+
encoding: 'utf-8',
|
|
102
|
+
}).trim();
|
|
103
|
+
execSync(`git checkout ${headSha}`, { cwd: repoDir, stdio: 'ignore' });
|
|
104
|
+
syncDocsIntoRepo(repoPath, repoDir);
|
|
105
|
+
const runner = new ClaudeRunner(repoDir, {}, model, 'high');
|
|
106
|
+
await runner.run(prompt);
|
|
107
|
+
syncDocsIntoRepo(repoDir, repoPath);
|
|
108
|
+
}
|
|
109
|
+
catch (err) {
|
|
110
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
111
|
+
console.warn(` [DocsWriter] Failed: ${msg.slice(0, 200)}`);
|
|
112
|
+
}
|
|
113
|
+
finally {
|
|
114
|
+
try {
|
|
115
|
+
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
// ignore cleanup failures
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=docs-writer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs-writer.js","sourceRoot":"","sources":["../src/docs-writer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,IAAI,MAAM,MAAM,CAAA;AAEvB,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAIjD,MAAM,UAAU,qBAAqB,CAAC,KAAmB;IACvD,MAAM,QAAQ,GAAa,EAAE,CAAA;IAE7B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAA;QAC/C,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;YAAE,SAAQ;QAEtD,QAAQ,CAAC,IAAI,CACX,OAAO,IAAI,CAAC,SAAS,YAAY,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ;YAC9D,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAC5C,CAAA;IACH,CAAC;IAED,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AAC9B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,QAAgB,EAChB,gBAAwB,EACxB,KAAa;IAEb,OAAO,CAAC,GAAG,CAAC,+CAA+C,CAAC,CAAA;IAC5D,MAAM,OAA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AAE,CAAC,CAAA;IAC7D,CAAC;YAAS,CAAC;QACT,IAAI,CAAC;YACH,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;QACtD,CAAC;QAAC,MAAM,CAAC;YACP,0BAA0B;QAC5B,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CarvedFeature, FileOperation } from "./carve-features";
|
|
2
|
+
import type { AgentStep } from "./runners/runner";
|
|
3
|
+
export declare function selectRandom<T>(items: T[], count: number): T[];
|
|
4
|
+
export declare function applyCarveOperations(repoDir: string, operations: FileOperation[]): void;
|
|
5
|
+
export declare function extractDocsRead(steps: AgentStep[]): string[];
|
|
6
|
+
export declare function computeGroundTruthDiff(feature: CarvedFeature): string;
|
|
7
|
+
export declare function getGroundTruthDiff(feature: CarvedFeature): string;
|
|
8
|
+
export declare function ensureGitIdentity(repoPath: string): void;
|
|
9
|
+
export declare function captureGitDiff(repoPath: string, options?: {
|
|
10
|
+
baseRef?: string;
|
|
11
|
+
pathspecs?: string[];
|
|
12
|
+
}): string;
|
|
13
|
+
export declare function copyDocsIntoRepo(sourceRepoPath: string, targetRepoPath: string): void;
|
|
14
|
+
export declare function syncDocsIntoRepo(sourceRepoPath: string, targetRepoPath: string): string[];
|
|
15
|
+
export declare function getDocsSnapshot(repoPath: string): Record<string, string>;
|
|
16
|
+
export declare function computeDocsDiffText(before: Record<string, string>, after: Record<string, string>): string;
|
|
17
|
+
/** Truncate individual file diffs and the overall diff to stay within context limits. */
|
|
18
|
+
export declare function truncateDiff(diff: string, maxFileChars?: number, maxTotalChars?: number): string;
|
|
19
|
+
//# sourceMappingURL=eval-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eval-helpers.d.ts","sourceRoot":"","sources":["../src/eval-helpers.ts"],"names":[],"mappings":"AAIA,OAAO,KA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AAI,EAAE,MAAM,EACZ,YAAY,SAAsB,EAClC,aAAa,SAAuB,GACnC,MAAM,CAwCR"}
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import { execFileSync } from "child_process";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import path from "path";
|
|
4
|
+
export function selectRandom(items, count) {
|
|
5
|
+
const shuffled = [...items].sort(() => Math.random() - 0.5);
|
|
6
|
+
return shuffled.slice(0, count);
|
|
7
|
+
}
|
|
8
|
+
export function applyCarveOperations(repoDir, operations) {
|
|
9
|
+
for (const op of operations) {
|
|
10
|
+
const fullPath = path.join(repoDir, op.path);
|
|
11
|
+
if (op.action === "delete") {
|
|
12
|
+
if (fs.existsSync(fullPath)) {
|
|
13
|
+
fs.rmSync(fullPath);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
else if (op.action === "modify" && op.newContent !== undefined) {
|
|
17
|
+
fs.mkdirSync(path.dirname(fullPath), { recursive: true });
|
|
18
|
+
fs.writeFileSync(fullPath, op.newContent);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
const DOC_PATH_PATTERN = /(?:^|\/)(?:docs\/|AGENTS\.md|CLAUDE\.md)/;
|
|
23
|
+
export function extractDocsRead(steps) {
|
|
24
|
+
const seen = new Set();
|
|
25
|
+
for (const step of steps) {
|
|
26
|
+
if (step.type !== "tool_call")
|
|
27
|
+
continue;
|
|
28
|
+
const toolName = step.toolName;
|
|
29
|
+
// Handle read tools (canonical: Read, read_file; Codebuff-native: read_files)
|
|
30
|
+
if (toolName === "Read" ||
|
|
31
|
+
toolName === "read_file" ||
|
|
32
|
+
toolName === "read_files") {
|
|
33
|
+
// Check single-path fields
|
|
34
|
+
const filePath = step.input?.file_path || step.input?.path;
|
|
35
|
+
if (typeof filePath === "string" && DOC_PATH_PATTERN.test(filePath)) {
|
|
36
|
+
const match = filePath.match(/((?:docs\/\S+|AGENTS\.md|CLAUDE\.md))/);
|
|
37
|
+
if (match)
|
|
38
|
+
seen.add(match[1]);
|
|
39
|
+
}
|
|
40
|
+
// Check array-of-paths (Codebuff read_files emits input.paths)
|
|
41
|
+
const paths = step.input?.paths;
|
|
42
|
+
if (Array.isArray(paths)) {
|
|
43
|
+
for (const p of paths) {
|
|
44
|
+
if (typeof p === "string" && DOC_PATH_PATTERN.test(p)) {
|
|
45
|
+
const match = p.match(/((?:docs\/\S+|AGENTS\.md|CLAUDE\.md))/);
|
|
46
|
+
if (match)
|
|
47
|
+
seen.add(match[1]);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
// Handle shell tools (canonical: shell; Codebuff-native: run_terminal_command)
|
|
54
|
+
if (toolName === "shell" || toolName === "run_terminal_command") {
|
|
55
|
+
const command = step.input?.command;
|
|
56
|
+
if (typeof command === "string" && DOC_PATH_PATTERN.test(command)) {
|
|
57
|
+
const matches = command.match(/((?:docs\/\S+|AGENTS\.md|CLAUDE\.md))/g);
|
|
58
|
+
if (matches)
|
|
59
|
+
for (const m of matches)
|
|
60
|
+
seen.add(m);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return [...seen].sort();
|
|
65
|
+
}
|
|
66
|
+
export function computeGroundTruthDiff(feature) {
|
|
67
|
+
const diffs = [];
|
|
68
|
+
for (const op of feature.operations) {
|
|
69
|
+
if (op.action === "delete" && feature.originalFiles[op.path]) {
|
|
70
|
+
const lines = feature.originalFiles[op.path].split("\n");
|
|
71
|
+
diffs.push(`--- /dev/null\n+++ b/${op.path}\n@@ -0,0 +1,${lines.length} @@\n` +
|
|
72
|
+
lines.map((l) => `+${l}`).join("\n"));
|
|
73
|
+
}
|
|
74
|
+
else if (op.action === "modify" && feature.originalFiles[op.path]) {
|
|
75
|
+
const origLines = feature.originalFiles[op.path].split("\n");
|
|
76
|
+
const carvedLines = (op.newContent || "").split("\n");
|
|
77
|
+
diffs.push(`--- a/${op.path}\n+++ b/${op.path}\n@@ -1,${carvedLines.length} +1,${origLines.length} @@\n` +
|
|
78
|
+
carvedLines.map((l) => `-${l}`).join("\n") +
|
|
79
|
+
"\n" +
|
|
80
|
+
origLines.map((l) => `+${l}`).join("\n"));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return diffs.join("\n\n");
|
|
84
|
+
}
|
|
85
|
+
export function getGroundTruthDiff(feature) {
|
|
86
|
+
// Prefer computeGroundTruthDiff which flips the carve into a rebuild diff
|
|
87
|
+
// (+ lines for code to be added back). feature.diff is the raw carve removal.
|
|
88
|
+
const rebuilt = computeGroundTruthDiff(feature);
|
|
89
|
+
if (rebuilt.trim())
|
|
90
|
+
return rebuilt;
|
|
91
|
+
return feature.diff;
|
|
92
|
+
}
|
|
93
|
+
export function ensureGitIdentity(repoPath) {
|
|
94
|
+
try {
|
|
95
|
+
execFileSync("git", ["config", "user.name", "Evalbuff"], {
|
|
96
|
+
cwd: repoPath,
|
|
97
|
+
stdio: "ignore",
|
|
98
|
+
});
|
|
99
|
+
execFileSync("git", ["config", "user.email", "evalbuff@example.invalid"], {
|
|
100
|
+
cwd: repoPath,
|
|
101
|
+
stdio: "ignore",
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
// best-effort only
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
export function captureGitDiff(repoPath, options = {}) {
|
|
109
|
+
const { baseRef = "HEAD", pathspecs = [] } = options;
|
|
110
|
+
const trackedArgs = ["diff", "--binary", baseRef];
|
|
111
|
+
if (pathspecs.length > 0)
|
|
112
|
+
trackedArgs.push("--", ...pathspecs);
|
|
113
|
+
let trackedDiff = "";
|
|
114
|
+
try {
|
|
115
|
+
trackedDiff = execFileSync("git", trackedArgs, {
|
|
116
|
+
cwd: repoPath,
|
|
117
|
+
encoding: "utf-8",
|
|
118
|
+
maxBuffer: 10 * 1024 * 1024,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
catch {
|
|
122
|
+
trackedDiff = "";
|
|
123
|
+
}
|
|
124
|
+
const untrackedFiles = listUntrackedFiles(repoPath, pathspecs);
|
|
125
|
+
const untrackedDiffs = untrackedFiles
|
|
126
|
+
.map((filePath) => captureUntrackedFileDiff(repoPath, filePath))
|
|
127
|
+
.filter(Boolean);
|
|
128
|
+
return [trackedDiff.trimEnd(), ...untrackedDiffs.map((d) => d.trimEnd())]
|
|
129
|
+
.filter(Boolean)
|
|
130
|
+
.join("\n");
|
|
131
|
+
}
|
|
132
|
+
export function copyDocsIntoRepo(sourceRepoPath, targetRepoPath) {
|
|
133
|
+
const changedPaths = syncDocsIntoRepo(sourceRepoPath, targetRepoPath);
|
|
134
|
+
if (changedPaths.length > 0) {
|
|
135
|
+
ensureGitIdentity(targetRepoPath);
|
|
136
|
+
try {
|
|
137
|
+
execFileSync("git", ["add", "-A", "--", ...changedPaths], {
|
|
138
|
+
cwd: targetRepoPath,
|
|
139
|
+
stdio: "ignore",
|
|
140
|
+
});
|
|
141
|
+
execFileSync("git", ["commit", "-m", "evalbuff: pre-load docs", "--allow-empty"], {
|
|
142
|
+
cwd: targetRepoPath,
|
|
143
|
+
stdio: "ignore",
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
catch {
|
|
147
|
+
// fine
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
export function syncDocsIntoRepo(sourceRepoPath, targetRepoPath) {
|
|
152
|
+
const sourceDocs = getDocsSnapshot(sourceRepoPath);
|
|
153
|
+
const targetDocs = getDocsSnapshot(targetRepoPath);
|
|
154
|
+
const changed = new Set();
|
|
155
|
+
for (const filePath of Object.keys(targetDocs)) {
|
|
156
|
+
if (filePath in sourceDocs)
|
|
157
|
+
continue;
|
|
158
|
+
fs.rmSync(path.join(targetRepoPath, filePath), { force: true });
|
|
159
|
+
removeEmptyDocDirs(targetRepoPath, filePath);
|
|
160
|
+
changed.add(filePath);
|
|
161
|
+
}
|
|
162
|
+
for (const [filePath, content] of Object.entries(sourceDocs)) {
|
|
163
|
+
if (targetDocs[filePath] === content)
|
|
164
|
+
continue;
|
|
165
|
+
const absolutePath = path.join(targetRepoPath, filePath);
|
|
166
|
+
fs.mkdirSync(path.dirname(absolutePath), { recursive: true });
|
|
167
|
+
fs.writeFileSync(absolutePath, content);
|
|
168
|
+
changed.add(filePath);
|
|
169
|
+
}
|
|
170
|
+
return [...changed].sort();
|
|
171
|
+
}
|
|
172
|
+
export function getDocsSnapshot(repoPath) {
|
|
173
|
+
const docs = {};
|
|
174
|
+
const docsDir = path.join(repoPath, "docs");
|
|
175
|
+
if (fs.existsSync(docsDir)) {
|
|
176
|
+
function readDir(dir, prefix) {
|
|
177
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
178
|
+
if (entry.isDirectory()) {
|
|
179
|
+
readDir(path.join(dir, entry.name), `${prefix}${entry.name}/`);
|
|
180
|
+
}
|
|
181
|
+
else if (entry.name.endsWith(".md")) {
|
|
182
|
+
docs[`docs/${prefix}${entry.name}`] = fs.readFileSync(path.join(dir, entry.name), "utf-8");
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
readDir(docsDir, "");
|
|
187
|
+
}
|
|
188
|
+
for (const file of ["AGENTS.md", "CLAUDE.md"]) {
|
|
189
|
+
const p = path.join(repoPath, file);
|
|
190
|
+
if (fs.existsSync(p)) {
|
|
191
|
+
docs[file] = fs.readFileSync(p, "utf-8");
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return docs;
|
|
195
|
+
}
|
|
196
|
+
export function computeDocsDiffText(before, after) {
|
|
197
|
+
const lines = [];
|
|
198
|
+
const allKeys = new Set([...Object.keys(before), ...Object.keys(after)]);
|
|
199
|
+
for (const key of [...allKeys].sort()) {
|
|
200
|
+
if (!(key in before)) {
|
|
201
|
+
lines.push(`\n=== NEW FILE: ${key} ===`);
|
|
202
|
+
lines.push(after[key]);
|
|
203
|
+
}
|
|
204
|
+
else if (!(key in after)) {
|
|
205
|
+
lines.push(`\n=== DELETED FILE: ${key} ===`);
|
|
206
|
+
lines.push(`(was ${before[key].split("\n").length} lines)`);
|
|
207
|
+
}
|
|
208
|
+
else if (before[key] !== after[key]) {
|
|
209
|
+
lines.push(`\n=== MODIFIED FILE: ${key} ===`);
|
|
210
|
+
lines.push(`--- before`);
|
|
211
|
+
lines.push(`+++ after`);
|
|
212
|
+
const oldLines = before[key].split("\n");
|
|
213
|
+
const newLines = after[key].split("\n");
|
|
214
|
+
const maxLen = Math.max(oldLines.length, newLines.length);
|
|
215
|
+
for (let i = 0; i < maxLen; i++) {
|
|
216
|
+
if (i >= oldLines.length) {
|
|
217
|
+
lines.push(`+${newLines[i]}`);
|
|
218
|
+
}
|
|
219
|
+
else if (i >= newLines.length) {
|
|
220
|
+
lines.push(`-${oldLines[i]}`);
|
|
221
|
+
}
|
|
222
|
+
else if (oldLines[i] !== newLines[i]) {
|
|
223
|
+
lines.push(`-${oldLines[i]}`);
|
|
224
|
+
lines.push(`+${newLines[i]}`);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
return lines.join("\n");
|
|
230
|
+
}
|
|
231
|
+
const MAX_FILE_DIFF_CHARS = 150_000;
|
|
232
|
+
const MAX_TOTAL_DIFF_CHARS = 500_000;
|
|
233
|
+
/** Truncate individual file diffs and the overall diff to stay within context limits. */
|
|
234
|
+
export function truncateDiff(diff, maxFileChars = MAX_FILE_DIFF_CHARS, maxTotalChars = MAX_TOTAL_DIFF_CHARS) {
|
|
235
|
+
if (diff.length <= maxFileChars)
|
|
236
|
+
return diff;
|
|
237
|
+
// Split into per-file chunks (each starts with "diff --git" or "diff --no-index")
|
|
238
|
+
const fileChunks = [];
|
|
239
|
+
const fileDiffPattern = /^diff --/gm;
|
|
240
|
+
let lastIndex = 0;
|
|
241
|
+
let match;
|
|
242
|
+
while ((match = fileDiffPattern.exec(diff)) !== null) {
|
|
243
|
+
if (match.index > lastIndex) {
|
|
244
|
+
fileChunks.push(diff.slice(lastIndex, match.index));
|
|
245
|
+
}
|
|
246
|
+
lastIndex = match.index;
|
|
247
|
+
}
|
|
248
|
+
if (lastIndex < diff.length) {
|
|
249
|
+
fileChunks.push(diff.slice(lastIndex));
|
|
250
|
+
}
|
|
251
|
+
// Truncate each file's diff individually
|
|
252
|
+
const truncatedChunks = fileChunks.map((chunk) => {
|
|
253
|
+
if (chunk.length <= maxFileChars)
|
|
254
|
+
return chunk;
|
|
255
|
+
const cut = chunk.slice(0, maxFileChars);
|
|
256
|
+
const lastNewline = cut.lastIndexOf("\n");
|
|
257
|
+
const cutPoint = lastNewline > maxFileChars * 0.8 ? lastNewline : maxFileChars;
|
|
258
|
+
const omitted = chunk.length - cutPoint;
|
|
259
|
+
return `${chunk.slice(0, cutPoint)}\n\n... [FILE TRUNCATED — ${omitted.toLocaleString()} characters omitted] ...`;
|
|
260
|
+
});
|
|
261
|
+
// Cap overall size
|
|
262
|
+
let result = truncatedChunks.join("");
|
|
263
|
+
if (result.length > maxTotalChars) {
|
|
264
|
+
const cut = result.slice(0, maxTotalChars);
|
|
265
|
+
const lastNewline = cut.lastIndexOf("\n");
|
|
266
|
+
const cutPoint = lastNewline > maxTotalChars * 0.8 ? lastNewline : maxTotalChars;
|
|
267
|
+
const omitted = result.length - cutPoint;
|
|
268
|
+
result = `${result.slice(0, cutPoint)}\n\n... [DIFF TRUNCATED — ${omitted.toLocaleString()} characters omitted] ...`;
|
|
269
|
+
}
|
|
270
|
+
return result;
|
|
271
|
+
}
|
|
272
|
+
function listUntrackedFiles(repoPath, pathspecs) {
|
|
273
|
+
const args = ["ls-files", "--others", "--exclude-standard"];
|
|
274
|
+
if (pathspecs.length > 0)
|
|
275
|
+
args.push("--", ...pathspecs);
|
|
276
|
+
try {
|
|
277
|
+
const output = execFileSync("git", args, {
|
|
278
|
+
cwd: repoPath,
|
|
279
|
+
encoding: "utf-8",
|
|
280
|
+
}).trim();
|
|
281
|
+
return output ? output.split("\n").filter(Boolean) : [];
|
|
282
|
+
}
|
|
283
|
+
catch {
|
|
284
|
+
return [];
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
function captureUntrackedFileDiff(repoPath, filePath) {
|
|
288
|
+
try {
|
|
289
|
+
return execFileSync("git", ["diff", "--binary", "--no-index", "--", "/dev/null", filePath], {
|
|
290
|
+
cwd: repoPath,
|
|
291
|
+
encoding: "utf-8",
|
|
292
|
+
maxBuffer: 10 * 1024 * 1024,
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
catch (error) {
|
|
296
|
+
const output = error instanceof Error && "stdout" in error
|
|
297
|
+
? String(error.stdout || "")
|
|
298
|
+
: "";
|
|
299
|
+
return output;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
function removeEmptyDocDirs(repoPath, filePath) {
|
|
303
|
+
let currentDir = path.dirname(path.join(repoPath, filePath));
|
|
304
|
+
const docsRoot = path.join(repoPath, "docs");
|
|
305
|
+
while (currentDir.startsWith(docsRoot) && currentDir !== docsRoot) {
|
|
306
|
+
try {
|
|
307
|
+
if (fs.readdirSync(currentDir).length > 0)
|
|
308
|
+
break;
|
|
309
|
+
fs.rmdirSync(currentDir);
|
|
310
|
+
currentDir = path.dirname(currentDir);
|
|
311
|
+
}
|
|
312
|
+
catch {
|
|
313
|
+
break;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
try {
|
|
317
|
+
if (currentDir === docsRoot &&
|
|
318
|
+
fs.existsSync(docsRoot) &&
|
|
319
|
+
fs.readdirSync(docsRoot).length === 0) {
|
|
320
|
+
fs.rmdirSync(docsRoot);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
catch {
|
|
324
|
+
// ignore cleanup failures
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
//# sourceMappingURL=eval-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eval-helpers.js","sourceRoot":"","sources":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K;YAChD,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;YACxB,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;QACvC,CAAC;QAAC,MAAM,CAAC;YACP,MAAK;QACP,CAAC;IACH,CAAC;IAED,IAAI,CAAC;QACH,IACE,UAAU,KAAK,QAAQ;YACvB,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;YACvB,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,MAAM,KAAK,CAAC,EACrC,CAAC;YACD,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAA;QACxB,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,0BAA0B;IAC5B,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { CarvedFeature } from './carve-features';
|
|
2
|
+
import type { JudgingResult } from './judge';
|
|
3
|
+
export interface TaskResult {
|
|
4
|
+
featureId: string;
|
|
5
|
+
prompt: string;
|
|
6
|
+
score: number;
|
|
7
|
+
diff: string;
|
|
8
|
+
trace: string;
|
|
9
|
+
judging: JudgingResult;
|
|
10
|
+
costEstimate: number;
|
|
11
|
+
docsRead: string[];
|
|
12
|
+
}
|
|
13
|
+
export declare function runAgentOnCarve(opts: {
|
|
14
|
+
idx: number;
|
|
15
|
+
total: number;
|
|
16
|
+
repoPath: string;
|
|
17
|
+
feature: CarvedFeature;
|
|
18
|
+
initCommand?: string;
|
|
19
|
+
model: string;
|
|
20
|
+
groundTruthDiff: string;
|
|
21
|
+
docsSourcePath: string;
|
|
22
|
+
}): Promise<TaskResult>;
|
|
23
|
+
/**
|
|
24
|
+
* Re-judge a baseline task using the current docs in docsSourcePath.
|
|
25
|
+
*
|
|
26
|
+
* Recreates the exact repo state the original judge saw (carved repo + agent's
|
|
27
|
+
* baseline diff applied), but with whatever docs currently live in
|
|
28
|
+
* docsSourcePath instead of the baseline-era docs. This isolates whether the
|
|
29
|
+
* judge itself scores differently once given better docs, independent of any
|
|
30
|
+
* agent behavior change.
|
|
31
|
+
*/
|
|
32
|
+
export declare function rejudgeBaselineWithCurrentDocs(opts: {
|
|
33
|
+
idx: number;
|
|
34
|
+
total: number;
|
|
35
|
+
repoPath: string;
|
|
36
|
+
feature: CarvedFeature;
|
|
37
|
+
baselineDiff: string;
|
|
38
|
+
groundTruthDiff: string;
|
|
39
|
+
initCommand?: string;
|
|
40
|
+
docsSourcePath: string;
|
|
41
|
+
}): Promise<JudgingResult>;
|
|
42
|
+
//# sourceMappingURL=eval-runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eval-runner.d.ts","sourceRoot":"","sources":["../src/eval-runner.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAK5C,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,aAAa,CAAA;IACtB,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAA;CACnB;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,aAAa,CAAA;IACtB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,eAAe,EAAE,MAAM,CAAA;IACvB,cAAc,EAAE,MAAM,CAAA;CACvB,GAAG,OAAO,CAAC,UAAU,CAAC,CAiGtB;AAED;;;;;;;;GAQG;AACH,wBAAsB,8BAA8B,CAAC,IAAI,EAAE;IACzD,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,aAAa,CAAA;IACtB,YAAY,EAAE,MAAM,CAAA;IACpB,eAAe,EAAE,MAAM,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,MAAM,CAAA;CACvB,GAAG,OAAO,CAAC,aAAa,CAAC,CAmEzB"}
|