@workermill/agent 0.4.7 → 0.5.0
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/dist/plan-validator.d.ts +1 -1
- package/dist/plan-validator.js +3 -3
- package/dist/planner.js +50 -27
- package/package.json +1 -1
package/dist/plan-validator.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export interface CriticResult {
|
|
|
39
39
|
suggestedChanges?: string[];
|
|
40
40
|
}>;
|
|
41
41
|
}
|
|
42
|
-
declare const AUTO_APPROVAL_THRESHOLD =
|
|
42
|
+
declare const AUTO_APPROVAL_THRESHOLD = 80;
|
|
43
43
|
/**
|
|
44
44
|
* Parse execution plan JSON from raw Claude CLI output.
|
|
45
45
|
* Mirrors server-side parseExecutionPlan() in planning-agent-local.ts.
|
package/dist/plan-validator.js
CHANGED
|
@@ -16,7 +16,7 @@ import { generateText } from "./providers.js";
|
|
|
16
16
|
// CONSTANTS
|
|
17
17
|
// ============================================================================
|
|
18
18
|
const MAX_TARGET_FILES = 5;
|
|
19
|
-
const AUTO_APPROVAL_THRESHOLD =
|
|
19
|
+
const AUTO_APPROVAL_THRESHOLD = 80;
|
|
20
20
|
// ============================================================================
|
|
21
21
|
// PLAN PARSING
|
|
22
22
|
// ============================================================================
|
|
@@ -100,7 +100,7 @@ Review this execution plan against the PRD:
|
|
|
100
100
|
1. **Missing Requirements** - Does the plan cover what the PRD asks for?
|
|
101
101
|
2. **Vague Instructions** - Will the worker know what to do?
|
|
102
102
|
3. **Security Issues** - Only for tasks involving auth, user data, or external input
|
|
103
|
-
4. **Unrealistic Scope** - Any step targeting >3 files MUST score below
|
|
103
|
+
4. **Unrealistic Scope** - Any step targeting >3 files MUST score below 80 (auto-rejection threshold). Each step should modify at most 3 files. If a step needs more, split it into multiple steps first.
|
|
104
104
|
5. **Missing Operational Steps** - If the PRD requires deployment, provisioning, migrations, or running commands, does the plan include operational steps? Writing code is not the same as deploying it.
|
|
105
105
|
6. **Overlapping File Scope** - If two or more steps share the same targetFiles, this causes parallel merge conflicts. Steps MUST NOT overlap on targetFiles. Deduct 10 points per shared file across steps.
|
|
106
106
|
|
|
@@ -117,7 +117,7 @@ Respond with ONLY a JSON object (no markdown, no explanation):
|
|
|
117
117
|
{"approved": boolean, "score": number, "risks": ["risk1", "risk2"], "suggestions": ["suggestion1", "suggestion2"], "storyFeedback": [{"storyId": "step-0", "feedback": "specific feedback", "suggestedChanges": ["change1"]}]}
|
|
118
118
|
|
|
119
119
|
Rules:
|
|
120
|
-
- approved = true if score >=
|
|
120
|
+
- approved = true if score >= 80 AND plan is right-sized for task
|
|
121
121
|
- risks = specific issues (empty array if none)
|
|
122
122
|
- suggestions = actionable improvements (empty array if none)
|
|
123
123
|
- storyFeedback = per-step feedback (optional, only for steps that need changes)`;
|
package/dist/planner.js
CHANGED
|
@@ -390,42 +390,65 @@ function runAnalyst(name, claudePath, model, prompt, repoPath, env, timeoutMs =
|
|
|
390
390
|
});
|
|
391
391
|
}
|
|
392
392
|
/** Analyst prompt templates */
|
|
393
|
-
const CODEBASE_ANALYST_PROMPT = `You are
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
393
|
+
const CODEBASE_ANALYST_PROMPT = `You are a codebase analyst. Your job is to explore this repository using tools and report what you find.
|
|
394
|
+
|
|
395
|
+
IMPORTANT: You MUST use tools to explore the repository. Do NOT guess or make assumptions.
|
|
396
|
+
|
|
397
|
+
Step 1: Run Glob with pattern "**/*" to see the top-level directory structure.
|
|
398
|
+
Step 2: Read key files: package.json, tsconfig.json, README.md, .env.example, or equivalents.
|
|
399
|
+
Step 3: Run Glob on src/ or the main source directory to understand the code layout.
|
|
400
|
+
Step 4: Read 2-3 representative source files to understand patterns and frameworks.
|
|
401
|
+
|
|
402
|
+
After exploring, write a report covering:
|
|
403
|
+
1. Directory structure and organization
|
|
404
|
+
2. Languages, frameworks, and key dependencies (from package.json, requirements.txt, etc.)
|
|
405
|
+
3. Existing test files and testing patterns (search for test/, __tests__, *.test.*, *.spec.*)
|
|
406
|
+
4. CI/CD configuration (search for .github/workflows/, Jenkinsfile, etc.)
|
|
407
|
+
5. Configuration files and environment setup
|
|
408
|
+
|
|
409
|
+
Keep your report under 2000 words. Only report facts you verified with tools.`;
|
|
402
410
|
function makeRequirementsAnalystPrompt(task) {
|
|
403
|
-
return `
|
|
411
|
+
return `You are a requirements analyst. Analyze the following task and the repository to identify what needs to be built.
|
|
404
412
|
|
|
405
|
-
|
|
413
|
+
Task: ${task.summary}
|
|
406
414
|
${task.description ? `\nDescription:\n${task.description}` : ""}
|
|
407
415
|
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
416
|
+
IMPORTANT: You MUST use tools to understand the existing codebase before analyzing requirements.
|
|
417
|
+
|
|
418
|
+
Step 1: Run Glob with pattern "**/*" to see what already exists in the repository.
|
|
419
|
+
Step 2: Read any existing README, docs, or configuration to understand the current state.
|
|
420
|
+
Step 3: Search for any code related to the task requirements using Grep.
|
|
421
|
+
|
|
422
|
+
After exploring, write a report covering:
|
|
423
|
+
1. Explicit acceptance criteria — what MUST be built based on the description
|
|
424
|
+
2. Implicit requirements — what's assumed but not stated (auth, error handling, etc.)
|
|
425
|
+
3. What already exists vs what needs to be created (based on your file exploration)
|
|
426
|
+
4. Ambiguities that could lead to wrong implementation
|
|
427
|
+
5. Suggested components/modules and which persona should own each
|
|
428
|
+
|
|
414
429
|
Keep your report under 1500 words.`;
|
|
415
430
|
}
|
|
416
431
|
function makeRiskAssessorPrompt(task) {
|
|
417
|
-
return `You are
|
|
418
|
-
|
|
432
|
+
return `You are a risk assessor. Your job is to search this repository for potential risks and blockers for a development task.
|
|
433
|
+
|
|
434
|
+
Task: ${task.summary}
|
|
419
435
|
${task.description ? `\nDescription:\n${task.description}` : ""}
|
|
420
436
|
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
1
|
|
424
|
-
2
|
|
425
|
-
3
|
|
426
|
-
4
|
|
427
|
-
|
|
428
|
-
|
|
437
|
+
IMPORTANT: You MUST use tools to search the codebase. Do NOT guess file paths or make assumptions.
|
|
438
|
+
|
|
439
|
+
Step 1: Run Glob with pattern "**/*" to see the full repository structure.
|
|
440
|
+
Step 2: Use Grep to search for code related to the task (relevant keywords, APIs, components).
|
|
441
|
+
Step 3: Read files that are likely to be modified or affected by this task.
|
|
442
|
+
Step 4: Search for existing tests (Grep for "test", "spec", "describe", "it(") to find test coverage.
|
|
443
|
+
|
|
444
|
+
After exploring, write a report covering:
|
|
445
|
+
1. Specific files that will need to be modified (exact paths from your search)
|
|
446
|
+
2. Files with heavy coupling or shared dependencies (imports you found)
|
|
447
|
+
3. Existing tests that will need updating (exact file paths)
|
|
448
|
+
4. Environment, config, or migration requirements
|
|
449
|
+
5. Deployment or infrastructure risks
|
|
450
|
+
|
|
451
|
+
Keep your report under 1500 words. Only report facts you verified with tools.`;
|
|
429
452
|
}
|
|
430
453
|
/**
|
|
431
454
|
* Run team planning: spawn 3 parallel analyst agents, then synthesize
|