taskplane 0.9.0 → 0.9.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.
@@ -174,7 +174,7 @@ const DEFAULT_CONFIG: TaskConfig = {
174
174
  standards_overrides: {},
175
175
  task_areas: {},
176
176
  worker: { model: "", tools: "read,write,edit,bash,grep,find,ls", thinking: "off" },
177
- reviewer: { model: "openai/gpt-5.3-codex", tools: "read,bash,grep,find,ls", thinking: "on" },
177
+ reviewer: { model: "", tools: "read,bash,grep,find,ls", thinking: "on" },
178
178
  context: {
179
179
  worker_context_window: 0, warn_percent: 85, kill_percent: 95,
180
180
  max_worker_iterations: 20, max_review_cycles: 2, no_progress_limit: 3,
@@ -633,56 +633,6 @@ function resolveRpcWrapperPath(): string {
633
633
  );
634
634
  }
635
635
 
636
- /**
637
- * Resolve the path to this extension file (task-runner.ts).
638
- * Used to pass the extension to worker subprocesses so they have access
639
- * to the review_step tool in orchestrated mode.
640
- *
641
- * Resolution strategy:
642
- * 1. Derive from -e argument that loaded this extension
643
- * 2. Package root + extensions/task-runner.ts
644
- * 3. cwd/extensions/task-runner.ts (development fallback)
645
- *
646
- * Returns null if the extension path cannot be found (non-fatal — worker
647
- * runs without review_step tool).
648
- */
649
- function resolveExtensionPath(): string | null {
650
- const extRelPath = join("extensions", "task-runner.ts");
651
-
652
- // 1. Derive from the -e argument that loaded this file
653
- try {
654
- const args = process.argv;
655
- for (let i = 0; i < args.length - 1; i++) {
656
- if (args[i] === "-e" && args[i + 1]?.includes("task-runner")) {
657
- const extPath = resolve(args[i + 1]);
658
- if (existsSync(extPath)) return extPath;
659
- }
660
- }
661
- } catch { /* ignore argv parsing errors */ }
662
-
663
- // 2. Package root
664
- const root = findPackageRoot();
665
- if (root) {
666
- const p = join(root, extRelPath);
667
- if (existsSync(p)) return p;
668
- }
669
-
670
- // 3. Development fallback
671
- const devPath = join(process.cwd(), extRelPath);
672
- if (existsSync(devPath)) return devPath;
673
-
674
- return null;
675
- }
676
-
677
- /**
678
- * Detect whether this extension instance is running inside a worker subprocess
679
- * (set via TASK_RUNNER_WORKER_TOOL_MODE env var). When true, the extension only
680
- * registers the review_step tool — no commands, widgets, or auto-start.
681
- */
682
- function isWorkerToolMode(): boolean {
683
- return process.env.TASK_RUNNER_WORKER_TOOL_MODE === "1";
684
- }
685
-
686
636
  /**
687
637
  * Load an agent definition with prompt inheritance.
688
638
  *
@@ -2080,6 +2030,7 @@ export default function (pi: ExtensionAPI) {
2080
2030
  "Call review_step at step boundaries based on the task's Review Level (from STATUS.md header).",
2081
2031
  "Review Level 0: skip all reviews. Level 1: plan review before implementing. Level 2: plan + code review. Level 3: plan + code + test review.",
2082
2032
  "Skip reviews for Step 0 (Preflight) and the final documentation/delivery step.",
2033
+ "For code reviews: before starting a step, capture the current HEAD commit with `git rev-parse HEAD` and pass it as the `baseline` parameter. This lets the reviewer see only that step's changes.",
2083
2034
  "On REVISE: read the review file in .reviews/ for detailed feedback, address the issues, commit fixes, then proceed.",
2084
2035
  "On RETHINK: reconsider your plan approach, adjust, then implement.",
2085
2036
  "On UNAVAILABLE: reviewer failed — proceed with caution.",
@@ -2090,9 +2041,14 @@ export default function (pi: ExtensionAPI) {
2090
2041
  [Type.Literal("plan"), Type.Literal("code")],
2091
2042
  { description: 'Review type: "plan" or "code"' },
2092
2043
  ),
2044
+ baseline: Type.Optional(Type.String({
2045
+ description: "Git commit SHA to use as the diff baseline for code reviews. " +
2046
+ "Capture HEAD before starting a step and pass it here so the reviewer " +
2047
+ "sees only that step's changes. If omitted, the reviewer sees the full diff against HEAD.",
2048
+ })),
2093
2049
  }),
2094
2050
  async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
2095
- const { step: stepNum, type: reviewType } = params;
2051
+ const { step: stepNum, type: reviewType, baseline } = params;
2096
2052
 
2097
2053
  if (!state.task || !state.config) {
2098
2054
  return {
@@ -2123,11 +2079,12 @@ export default function (pi: ExtensionAPI) {
2123
2079
  const requestPath = join(reviewsDir, `request-R${num}.md`);
2124
2080
  const outputPath = join(reviewsDir, `R${num}-${reviewType}-step${stepNum}.md`);
2125
2081
 
2126
- // Find step baseline commit for code reviews
2127
- let stepBaselineCommit: string | undefined;
2128
- if (reviewType === "code") {
2129
- stepBaselineCommit = getHeadCommitSha();
2130
- }
2082
+ // Resolve step baseline commit for code reviews.
2083
+ // The worker should pass the pre-step HEAD SHA as `baseline` so the
2084
+ // reviewer sees only this step's changes (not cumulative diff).
2085
+ // Falls back to undefined (full diff) if baseline is not provided.
2086
+ const stepBaselineCommit: string | undefined =
2087
+ reviewType === "code" ? (baseline || undefined) : undefined;
2131
2088
 
2132
2089
  // Find step info for the name
2133
2090
  const stepInfo = task.steps.find(s => s.number === stepNum);
@@ -2143,7 +2100,7 @@ export default function (pi: ExtensionAPI) {
2143
2100
  const reviewerDef = loadAgentDef(ctx.cwd, "task-reviewer");
2144
2101
  const reviewerModel = config.reviewer.model
2145
2102
  || reviewerDef?.model
2146
- || "openai/gpt-5.3-codex";
2103
+ || (ctx.model ? `${ctx.model.provider}/${ctx.model.id}` : "anthropic/claude-sonnet-4-20250514");
2147
2104
  const reviewerPrompt = reviewerDef?.systemPrompt
2148
2105
  || "You are a code reviewer. Read the request and write your review to the specified output file.";
2149
2106
  const systemPrompt = reviewerPrompt + "\n\n" + buildProjectContext(config, task.taskFolder);
@@ -2947,7 +2904,7 @@ export default function (pi: ExtensionAPI) {
2947
2904
  writeFileSync(requestPath, request);
2948
2905
 
2949
2906
  const reviewerDef = loadAgentDef(ctx.cwd, "task-reviewer");
2950
- const reviewerModel = config.reviewer.model || reviewerDef?.model || "openai/gpt-5.3-codex";
2907
+ const reviewerModel = config.reviewer.model || reviewerDef?.model || (ctx.model ? `${ctx.model.provider}/${ctx.model.id}` : "anthropic/claude-sonnet-4-20250514");
2951
2908
  const reviewerPrompt = reviewerDef?.systemPrompt || "You are a code reviewer. Read the request and write your review to the specified output file.";
2952
2909
  const systemPrompt = reviewerPrompt + "\n\n" + buildProjectContext(config, task.taskFolder);
2953
2910
 
@@ -3086,7 +3043,7 @@ export default function (pi: ExtensionAPI) {
3086
3043
  const reviewModel = config.quality_gate.review_model
3087
3044
  || config.reviewer.model
3088
3045
  || reviewerDef?.model
3089
- || "openai/gpt-5.3-codex";
3046
+ || (ctx.model ? `${ctx.model.provider}/${ctx.model.id}` : "anthropic/claude-sonnet-4-20250514");
3090
3047
 
3091
3048
  const reviewerPrompt = reviewerDef?.systemPrompt
3092
3049
  || "You are a quality gate reviewer. Read the review request and write your JSON verdict to the specified file.";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taskplane",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "AI agent orchestration for pi — parallel task execution with checkpoint discipline",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -187,11 +187,12 @@ value.
187
187
  **Example flow for a Review Level 2 task, Step 3:**
188
188
  1. Read Step 3 requirements
189
189
  2. Call `review_step(step=3, type="plan")` → get plan feedback
190
- 3. Implement Step 3
191
- 4. Commit changes
192
- 5. Call `review_step(step=3, type="code")` → get code feedback
193
- 6. If REVISE: fix issues, commit again
194
- 7. Move to Step 4
190
+ 3. Capture baseline: run `git rev-parse HEAD` and save the SHA
191
+ 4. Implement Step 3
192
+ 5. Commit changes
193
+ 6. Call `review_step(step=3, type="code", baseline="<saved SHA>")` → get code feedback
194
+ 7. If REVISE: fix issues, commit again
195
+ 8. Move to Step 4
195
196
 
196
197
  If the `review_step` tool is not available (e.g., non-orchestrated mode), skip
197
198
  this protocol entirely — the task-runner handles reviews externally.