Skip to content

Commit 59665e4

Browse files
committed
Generate id per task
1 parent a5f3dda commit 59665e4

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

evals/git-evals2/gen-evals.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ export async function generateEvalFileV2({
246246
sha: commitSha,
247247
parentSha,
248248
spec,
249+
id: promptResult.id,
249250
prompt: promptResult.prompt,
250251
supplementalFiles: promptResult.supplementalFiles,
251252
fileDiffs,

evals/git-evals2/migrate-evals-to-v2.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,10 @@ async function migrateCommit(
104104
console.log(
105105
`Supplemental files: ${promptResult.supplementalFiles.length} files`,
106106
)
107+
console.log(`Task ID: ${promptResult.id}`)
107108

108109
return {
110+
id: promptResult.id,
109111
sha: commitSha,
110112
parentSha,
111113
spec: oldCommit.spec,

evals/git-evals2/prompt-generator.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ const promptGeneratorAgentDef: AgentDefinition = {
2020
outputSchema: {
2121
type: 'object',
2222
properties: {
23+
id: {
24+
type: 'string',
25+
description:
26+
'Short 2-3 word hyphenated task identifier (e.g., "fix-auth-bug", "add-user-profile", "refactor-login-flow")',
27+
},
2328
reasoning: {
2429
type: 'string',
2530
description: 'Your thoughts about what should be in the prompt',
@@ -38,7 +43,7 @@ const promptGeneratorAgentDef: AgentDefinition = {
3843
description: 'Confidence score 0-1 in the quality of the prompt',
3944
},
4045
},
41-
required: ['prompt', 'supplementalFiles', 'reasoning', 'confidence'],
46+
required: ['id', 'prompt', 'supplementalFiles', 'reasoning', 'confidence'],
4247
},
4348
systemPrompt: `You are an expert at analyzing git commits and generating high-level user prompts.
4449
@@ -54,8 +59,15 @@ ${PLACEHOLDER.KNOWLEDGE_FILES_CONTENTS}`,
5459
instructionsPrompt: `Your task:
5560
1. Analyze the git diff to understand what changed
5661
2. Use your tools (read_files, spawn_agents) to explore the codebase and understand context
57-
3. Identify supplemental files that would help a judge understand the change (exclude directly edited files)
58-
4. Generate a high-level user prompt that describes WHAT needs to be done (not HOW)
62+
3. Generate a short, descriptive task ID (2-3 hyphenated words like "fix-auth-bug" or "refactor-login-flow")
63+
4. Identify supplemental files that would help a judge understand the change (exclude directly edited files)
64+
5. Generate a high-level user prompt that describes WHAT needs to be done (not HOW)
65+
66+
Key principles for the task ID:
67+
- 2-3 words maximum, hyphenated (e.g., "fix-memory-leak", "add-user-profile", "refactor-auth-flow")
68+
- Descriptive but concise
69+
- Use action verbs when appropriate (fix, add, remove, refactor, update, implement)
70+
- Lowercase with hyphens
5971
6072
Key principles for the prompt:
6173
- Focus on the functional requirement, not implementation details
@@ -82,6 +94,7 @@ export async function generatePromptFromCommit({
8294
}
8395
agentDefinitions?: any[]
8496
}): Promise<{
97+
id: string
8598
prompt: string
8699
supplementalFiles: string[]
87100
confidence: number
@@ -117,6 +130,7 @@ export async function generatePromptFromCommit({
117130
}
118131

119132
return generatorResult.output.value as {
133+
id: string
120134
prompt: string
121135
supplementalFiles: string[]
122136
reasoning: string

evals/git-evals2/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export interface FileDiff {
2929
}
3030

3131
export interface EvalCommitV2 {
32+
id: string
3233
sha: string
3334
parentSha: string
3435
spec: string

0 commit comments

Comments
 (0)