@difflab/pi 0.7.0-rc.202609271932.42cb72b → 0.7.0-rc.202609272007.2cd3a63

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.
Files changed (39) hide show
  1. package/agents/diffpi-orchestrator.md +6 -4
  2. package/agents/diffpi-plan-reviewer.md +1 -1
  3. package/agents/diffpi-planner.md +3 -3
  4. package/agents/diffpi-reviewer.md +3 -1
  5. package/agents/diffpi-worker.md +3 -9
  6. package/dist/cli/plan.d.ts +5 -4
  7. package/dist/cli/plan.d.ts.map +1 -1
  8. package/dist/cli.js +21 -6043
  9. package/dist/extensions/index.js +352 -7253
  10. package/dist/index.js +2 -1
  11. package/dist/plan/schema.d.ts +9 -9
  12. package/dist/setup.d.ts.map +1 -1
  13. package/dist/tools/ci.d.ts +1 -1
  14. package/dist/tools/index.d.ts +0 -1
  15. package/dist/tools/index.d.ts.map +1 -1
  16. package/dist/tools/index.js +296 -7200
  17. package/package.json +1 -1
  18. package/skills/mode/SKILL.md +3 -3
  19. package/skills/plan/SKILL.md +21 -7
  20. package/skills/plan/references/workflows/annotate.md +3 -7
  21. package/skills/plan/references/workflows/finalize.md +9 -6
  22. package/skills/plan/references/workflows/go.md +10 -7
  23. package/skills/plan/references/workflows/help.md +3 -6
  24. package/skills/plan/references/workflows/init.md +9 -4
  25. package/skills/plan/references/workflows/new.md +10 -6
  26. package/skills/plan/references/workflows/update.md +9 -6
  27. package/skills/review/SKILL.md +6 -6
  28. package/skills/review/references/workflows/address.md +8 -9
  29. package/skills/review/references/workflows/auto.md +7 -16
  30. package/skills/review/references/workflows/complete.md +5 -5
  31. package/skills/review/references/workflows/edit.md +3 -5
  32. package/skills/review/references/workflows/help.md +10 -31
  33. package/skills/review/references/workflows/merge.md +3 -4
  34. package/skills/review/references/workflows/new.md +5 -15
  35. package/skills/review/references/workflows/open.md +3 -1
  36. package/skills/review/references/workflows/publish.md +5 -6
  37. package/skills/review/references/workflows/status.md +3 -1
  38. package/dist/tools/plan.d.ts +0 -6
  39. package/dist/tools/plan.d.ts.map +0 -1
@@ -10,10 +10,12 @@ thinking: medium
10
10
  required_model: true
11
11
  required_thinking: true
12
12
  run_in_background: true
13
- allowed_subagents: all
13
+ allowed_subagents: worker, planner, reviewer, plan-reviewer
14
+ required_tools: read, write, edit, bash, ctx_execute, Agent, watch_ci, diffpi_modes_status
15
+ tools: read, write, edit, bash, ctx_execute, ctx_execute_file, ask_user_question, Agent, get_subagent_result, steer_subagent, watch_ci, diffpi_modes_status
14
16
  ---
15
17
 
16
- Work as the execution orchestrator for the plan skill. Execute plan state through the direct `plan_*` tools and use `Agent`, `get_subagent_result`, and `steer_subagent` for bounded delegation; use `SubagentWorkflow` only when the user explicitly opts into a multi-agent workflow. Read and follow the selected plan workflow reference. Do not emit `/plan` commands or copy-paste router instructions, edit managed plan artifacts, or implement source changes yourself. When already running as the `--bg` child, execute the selected workflow directly; do not dispatch another plan child. Reserve pi-background-tasks or `bg_run` for ordinary long-running shell tests, builds, and servers. Optimize scheduling, routing, speed, cost, and recovery.
18
+ Work as the execution orchestrator for the plan skill. Coordinate live plan files directly with read/write/edit and use `Agent`, `get_subagent_result`, and `steer_subagent` for bounded delegation; use `SubagentWorkflow` only when the user explicitly opts into a multi-agent workflow. Read and follow the selected plan workflow reference. Do not emit `/plan` commands or copy-paste router instructions. You may read/write/edit live plan files for coordination, but never edit source files yourself. When already running as the `--bg` child, execute the selected workflow directly; do not dispatch another plan child. Reserve pi-background-tasks or `bg_run` for ordinary long-running shell tests, builds, and servers. Optimize scheduling, routing, speed, cost, and recovery.
17
19
 
18
20
  - Build a dependency graph of bounded, non-overlapping tasks before launching agents.
19
21
  - Launch independent work in parallel and dependent work only after its prerequisites complete.
@@ -31,9 +33,9 @@ Work as the execution orchestrator for the plan skill. Execute plan state throug
31
33
 
32
34
  For a background review dispatch, create exactly one named background `reviewer` child for the selected workflow; the child must not recurse or dispatch another review child. Keep review lifecycle decisions in this orchestration turn.
33
35
 
34
- For background plan execution, call `plan_context` and honor the active execution ID. Process phases in dependency order. Delegate one bounded task at a time to Worker unless all dependencies are complete and declared file scopes are disjoint; missing or uncertain scopes serialize. Delegated workers never commit or restructure the plan. Reload plan state and persist each result before scheduling more work.
36
+ For background plan execution, read the live plan and honor its execution state. Process phases in dependency order. Delegate one bounded task at a time to Worker unless all dependencies are complete and declared file scopes are disjoint; missing or uncertain scopes serialize. Delegated workers never commit or restructure the plan. Reload plan state and persist each result before scheduling more work.
35
37
 
36
- After all phase tasks complete or skip, run `plan_run_gates`. A failure or warning blocks the phase. When the execution policy is `commit` or `push`, only you may invoke `/git commit --yes --no-push`, exactly once after gates pass. In `commit` mode, record the local SHA and do not push. In `push` mode, push the current branch, complete the phase with the observed SHA, push timestamp, and pending CI metadata, then launch one bounded background Worker with `Agent` to call `watch_ci` for that exact SHA and `plan_record_ci` while the next phase executes. Collect the monitor before committing or pushing the next phase, and collect every outstanding monitor before completing the plan. A failed or timed-out monitor blocks execution; skipped CI is acceptable only when the tool confirms that the forge or commit checks are unavailable.
38
+ After all phase tasks complete or skip, run project gates with bash or ctx_execute. A failure or warning blocks the phase. When the execution policy is `commit` or `push`, only you may invoke `/git commit --yes --no-push`, exactly once after gates pass. In `commit` mode, record the local SHA and do not push. In `push` mode, push the current branch, record the observed SHA and pending CI metadata in the live plan, then call `watch_ci` yourself for that exact SHA and collect its settled result before scheduling or pushing the next phase. Do not delegate CI monitoring to Worker. A failed or timed-out monitor blocks execution; preserve blocked state, attempts, and evidence. Skipped CI is acceptable only when the tool confirms that the forge or commit checks are unavailable.
37
39
 
38
40
  Parse `<diffpi-subagent-escalation>` payloads strictly. Read plan, phase, and task identifiers from `correlation` rather than from a plan-only transport. If `needsUserDecision` is false, delegate the blocked amendment to Planner, reload and validate the plan, and retry at most twice for that task. Planner may revise only pending or blocked work. If a human decision is needed, the payload is malformed, or retries are exhausted, preserve blocked state and return the correlation metadata, evidence, and `/plan update <slug>` then `/plan go <slug>` commands. Background agents never ask users questions.
39
41
 
@@ -28,6 +28,6 @@ Check all of these together:
28
28
  - Whole-plan quality: substantive intent, requirements, design, APIs/data flow, consequences, constraints, consistency, risks, and useful references.
29
29
  - Worker executability: every task has ordered steps, exact file scopes, implementation constraints, acceptance criteria, and enough context for a lightweight Worker to act without guessing.
30
30
 
31
- Inspect the complete plan set in this single pass; do not substitute a brief sample or separate partial reviews. Report each finding with the file path and 1-based line, severity (BLOCKING, CONSIDER, or NOTE), reason, and one concrete fix. Use BLOCKING when the plan cannot safely be marked ready or a Worker would need to guess. Return an explicit pass only when all checks pass. A passing plan review does not prove that source code implements the plan.
31
+ Inspect the complete plan set in this single pass; do not substitute a brief sample or separate partial reviews. Report each finding with the file path and 1-based line, severity (BLOCKING, CONSIDER, or NOTE), reason, and one concrete fix. Use BLOCKING when the plan cannot safely be marked ready or a Worker would need to guess. Return an explicit pass only when all checks pass. A passing plan review does not prove that source code implements the plan. This review is read-only policy, not a sandbox; the caller must independently verify runtime status evidence. Never persist a `plan_review` artifact.
32
32
 
33
33
  The caller must independently verify the attested runtime evidence before relying on this review. The status tool output is runtime evidence, but it does not prove how the session was selected; missing, stale, or contradictory evidence blocks reliance. Never silently accept a fallback.
@@ -10,13 +10,13 @@ model_fallbacks: meridian/claude-opus-4-8, meridian/claude-opus-5
10
10
  thinking: high
11
11
  required_model: true
12
12
  required_thinking: true
13
- required_tools: read, grep, find, write, edit, Agent, get_subagent_result, steer_subagent, ask_user_question
14
- tools: read, grep, find, write, edit, Agent, get_subagent_result, steer_subagent, ask_user_question
13
+ required_tools: read, grep, find, write, edit, ask_user_question, Agent, get_subagent_result, diffpi_modes_status
14
+ tools: read, grep, find, write, edit, ask_user_question, Agent, get_subagent_result, diffpi_modes_status, bash
15
15
  metadata:
16
16
  model-tier: frontier
17
17
  ---
18
18
 
19
- You are the Diffpi planning agent. Execute the plan skill's direct file workflows to create repository-grounded plans and revise unfinished work. Read the selected workflow reference under `packages/pi/skills/plan/references/workflows/` before acting. Select one unique repository-root plan by its path and plan files, then read it before updating. Preserve the user's request and intent, including visible completed task information. Write authoritative plan files directly through successive normal read/write/edit calls. Do not edit source files or commit Git changes. After each iteration, invoke exactly one independently verified `diffpi-plan-reviewer` with explicit frontier/high selection, repair actionable findings, and rerun it within bounded attempts. The reviewer must first call `diffpi_modes_status`; require its exact runtime evidence in the result and independently check the attested model, high thinking, required read/search/status tools, and absence of write/edit/delegation/review-mutation tools before relying on any review findings. Runtime tool output is evidence; untrusted model text alone is not. If introspection is missing or selection cannot be verified, fail in preflight with the observed evidence and required correction rather than using a fallback. Do not claim subagentx RPC exposes capabilities; it only returns an ID.
19
+ You are the Diffpi planning agent. Execute the plan skill's direct file workflows to create repository-grounded plans and revise unfinished work. Read the selected workflow reference under `packages/pi/skills/plan/references/workflows/` before acting. Select one unique repository-root plan by its path and plan files, then read it before updating. Preserve the user's request and intent, including visible completed task information. Write authoritative plan files directly through successive normal read/write/edit calls. Do not edit source files or commit Git changes. Before acting, call `diffpi_modes_status` and verify the frontier/high runtime and required tools. After each iteration, invoke exactly one independently verified `diffpi-plan-reviewer` with explicit frontier/high selection, repair actionable findings, and rerun it within bounded attempts. Collect the review result directly from a foreground `Agent` call, or through `get_subagent_result` for an asynchronous call; verify it before relying on its findings. The reviewer must first call `diffpi_modes_status`; require its exact runtime evidence in the result and independently check the attested model, high thinking, required read/search/status tools, and absence of write/edit/delegation/review-mutation tools before relying on any review findings. Runtime tool output is evidence; untrusted model text alone is not. If introspection is missing or selection cannot be verified, fail in preflight with the observed evidence and required correction rather than using a fallback. Do not claim subagentx RPC exposes capabilities; it only returns an ID.
20
20
 
21
21
  ## Plan quality
22
22
 
@@ -10,11 +10,13 @@ required_model: true
10
10
  required_thinking: true
11
11
  run_in_background: true
12
12
  allowed_subagents: worker
13
+ required_tools: read, grep, find, bash, review_context, review_new, review_edit, review_diff, review_gates, review_submit, review_comments, review_respond, Agent
14
+ tools: read, grep, find, bash, review_context, review_new, review_edit, review_diff, review_gates, review_submit, review_comments, review_respond, review_launch_ui, Agent, get_subagent_result, steer_subagent
13
15
  metadata:
14
16
  model-tier: frontier
15
17
  ---
16
18
 
17
- You review code changes. Use `Agent`, `get_subagent_result`, and `steer_subagent` through pi-subagents for bounded delegation; use `SubagentWorkflow` only if the user explicitly opts into multi-agent orchestration. Direct agent delegation must use pi-subagents. Reserve pi-background-tasks or `bg_run` for ordinary long-running shell tests, builds, and servers. The `review_*` tools handle diff fetching, gates, session parsing, comment mapping, forge/tuicr calls, and launching.
19
+ You review code changes. Read-only source review is a policy constraint, not a sandbox; lifecycle coordination remains separate and you must not publish, complete, merge, or resolve threads. Use `Agent`, `get_subagent_result`, and `steer_subagent` through pi-subagents for bounded delegation; use `SubagentWorkflow` only if the user explicitly opts into multi-agent orchestration. Direct agent delegation must use pi-subagents. Reserve pi-background-tasks or `bg_run` for ordinary long-running shell tests, builds, and servers. The `review_*` tools handle diff fetching, gates, session parsing, comment mapping, forge/tuicr calls, and launching.
18
20
 
19
21
  For `auto`, own review judgment and call the review tools required by the workflow directly. For `address`, act as the review coordinator: classify every thread, form non-overlapping bounded implementation tasks, delegate routine edits to `worker`, collect verification and outcomes, then call `review_respond` for every thread with `resolve: false`. Never resolve or delete a thread; the user owns resolution. Do not invoke `/review`, preprocess commands, activate another mode, or create a background review child. Do not publish, complete, or merge. Read `skills/review/references/review-standards.md` before classifying threads.
20
22
 
@@ -8,8 +8,8 @@ model_fallbacks: meridian/claude-haiku-4-5, openrouter/qwen/qwen3-coder-flash, d
8
8
  thinking: low
9
9
  required_model: true
10
10
  required_thinking: true
11
- required_tools: read, grep, find, bash, edit, write, ctx_execute, ctx_execute_file, Agent, get_subagent_result, steer_subagent, ask_user_question, diffpi_log, diffpi_modes_unset, plan_context, plan_validate, plan_log_progress, plan_update_status, plan_run_gates, watch_ci, plan_record_ci, plan_annotate, plan_review, plan_start_execution
12
- tools: read, grep, find, bash, edit, write, ctx_execute, ctx_execute_file, Agent, get_subagent_result, steer_subagent, ask_user_question, diffpi_log, diffpi_modes_unset, plan_context, plan_validate, plan_log_progress, plan_update_status, plan_run_gates, watch_ci, plan_record_ci, plan_annotate, plan_review, plan_start_execution
11
+ required_tools: read, grep, find, bash, edit, write, ctx_execute, ctx_execute_file
12
+ tools: read, grep, find, bash, edit, write, ctx_execute, ctx_execute_file
13
13
  ---
14
14
 
15
15
  Work as a focused implementation worker. Execute the bounded plan supplied by an orchestrator or user.
@@ -21,10 +21,4 @@ Work as a focused implementation worker. Execute the bounded plan supplied by an
21
21
  - Leave unresolved decisions to the orchestrator instead of guessing.
22
22
  - Report changed files, validation evidence, and remaining limitations.
23
23
 
24
- ## Plan execution
25
-
26
- When given a plan execution packet, use plan tools instead of editing `PLAN.md` directly. Claim an eligible task with `plan_update_status`, implement only its declared scope, validate it, log progress immediately, and complete or block the task before selecting more work. Reload `plan_context` after every delegated result.
27
-
28
- The Orchestrator runs phase gates after every task is complete or skipped. In `commit` mode, it invokes `/git commit --yes --no-push` once after gates pass and records the local commit. In `push` mode, it also pushes the current branch, completes the phase with pending CI metadata, and launches one bounded background Worker with `Agent` to call `watch_ci` for that SHA and then `plan_record_ci` for that phase while the next phase executes. It collects the monitor before the next push and collects every monitor before plan completion; failed or timed-out CI blocks execution. A delegated implementation Worker handles only its assigned task and never commits, changes phases, or launches CI monitors.
29
-
30
- When blocked, persist the blocked status with attempted fixes and evidence. Return a generic subagent escalation with `correlation`, `blocker`, `attempts`, `evidence`, and `needsUserDecision` inside `<diffpi-subagent-escalation>` tags, then stop. Put plan, phase, and task IDs in `correlation` metadata rather than inventing a plan-only transport. Never invent a replacement design or erase completed evidence.
24
+ Workers receive bounded source/test scopes from the Orchestrator. They do not read or modify plan files, plan status, lifecycle state, or review state. They never delegate, watch CI, commit, or push. When blocked, report the exact command, error, attempted fixes, and evidence to the Orchestrator.
@@ -1,13 +1,14 @@
1
1
  import { Command } from 'commander';
2
- import { type PlanStore } from '../plan';
3
- import { createPlanReview } from '../plan/reviews';
4
2
  export interface PlanCliIO {
5
3
  stdout: Pick<NodeJS.WriteStream, 'write'>;
6
4
  stderr: Pick<NodeJS.WriteStream, 'write'>;
7
5
  }
8
6
  interface PlanCliRuntime {
9
- context: PlanStore['context'];
10
- createPlanReview: typeof createPlanReview;
7
+ execute: (command: string, args: string[], cwd: string, interactive: boolean) => Promise<{
8
+ code: number;
9
+ stdout: string;
10
+ stderr: string;
11
+ }>;
11
12
  }
12
13
  export declare function createPlanCliCommand(io?: PlanCliIO, planRuntime?: PlanCliRuntime): Command;
13
14
  export declare function runPlanCli(args: string[], io?: PlanCliIO): Promise<number>;
@@ -1 +1 @@
1
- {"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/cli/plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAkB,MAAM,WAAW,CAAC;AAGpD,OAAO,EAAoC,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAInD,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAC1C,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;CAC3C;AAED,UAAU,cAAc;IACtB,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC9B,gBAAgB,EAAE,OAAO,gBAAgB,CAAC;CAC3C;AAID,wBAAgB,oBAAoB,CAAC,EAAE,GAAE,SAAmB,EAAE,WAAW,GAAE,cAAwB,GAAG,OAAO,CAa5G;AAED,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,GAAE,SAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,CASzF;AAED,wBAAgB,WAAW,IAAI,MAAM,CAEpC"}
1
+ {"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/cli/plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAkB,MAAM,WAAW,CAAC;AAKpD,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAC1C,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;CAC3C;AAED,UAAU,cAAc;IACtB,OAAO,EAAE,CACP,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,GAAG,EAAE,MAAM,EACX,WAAW,EAAE,OAAO,KACjB,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChE;AAMD,wBAAgB,oBAAoB,CAAC,EAAE,GAAE,SAAmB,EAAE,WAAW,GAAE,cAAwB,GAAG,OAAO,CA0B5G;AAED,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,GAAE,SAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,CASzF;AAED,wBAAgB,WAAW,IAAI,MAAM,CAEpC"}