@difflab/pi 0.8.0 → 0.9.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/README.md +8 -10
- package/agents/diffpi-orchestrator.md +1 -1
- package/agents/diffpi-planner.md +2 -2
- package/agents/diffpi-reviewer.md +2 -2
- package/agents/diffpi-worker.md +6 -6
- package/dist/environment.d.ts +0 -1
- package/dist/environment.d.ts.map +1 -1
- package/dist/extensions/index.js +319 -1495
- package/dist/index.d.ts +5 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +140 -759
- package/dist/log.d.ts +6 -11
- package/dist/log.d.ts.map +1 -1
- package/dist/plan/verify.d.ts.map +1 -1
- package/dist/review/index.d.ts +2 -3
- package/dist/review/index.d.ts.map +1 -1
- package/dist/review/review-backend.d.ts +2 -3
- package/dist/review/review-backend.d.ts.map +1 -1
- package/dist/setup.d.ts +0 -2
- package/dist/setup.d.ts.map +1 -1
- package/dist/tools/index.js +319 -1495
- package/dist/tools/log.d.ts.map +1 -1
- package/dist/tools/review.d.ts +1 -7
- package/dist/tools/review.d.ts.map +1 -1
- package/dist/tools/setup.d.ts.map +1 -1
- package/package.json +1 -5
- package/skills/diffpi-setup/SKILL.md +3 -3
- package/skills/plan/SKILL.md +3 -4
- package/skills/plan/references/design-quality.md +1 -1
- package/skills/plan/references/workflows/finalize.md +2 -2
- package/skills/plan/references/workflows/go.md +7 -5
- package/skills/plan/references/workflows/help.md +1 -2
- package/skills/plan/references/workflows/init.md +2 -2
- package/skills/plan/references/workflows/inline-fallback.md +3 -3
- package/skills/plan/references/workflows/new.md +3 -3
- package/skills/plan/references/workflows/update.md +6 -4
- package/skills/plan/references/workflows/validate.md +5 -5
- package/skills/review/SKILL.md +5 -5
- package/skills/review/references/review-standards.md +9 -1
- package/skills/review/references/workflows/address.md +9 -15
- package/skills/review/references/workflows/auto.md +9 -17
- package/skills/review/references/workflows/complete.md +2 -2
- package/skills/review/references/workflows/edit.md +7 -5
- package/skills/review/references/workflows/help.md +12 -20
- package/skills/review/references/workflows/new.md +14 -13
- package/skills/review/references/workflows/publish.md +2 -2
- package/skills/review/references/workflows/status.md +1 -1
- package/skills/review/templates/REVIEW.md +39 -0
- package/templates/plan/PLAN.md +9 -1
- package/templates/review/draft-pr.md +3 -9
- package/dist/cli/plan.d.ts +0 -17
- package/dist/cli/plan.d.ts.map +0 -1
- package/dist/cli.d.ts +0 -4
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -2258
- package/dist/extensions/tuicrx.d.ts +0 -66
- package/dist/extensions/tuicrx.d.ts.map +0 -1
- package/dist/extensions/zedx.d.ts +0 -18
- package/dist/extensions/zedx.d.ts.map +0 -1
- package/dist/review/local-review-backend.d.ts +0 -3
- package/dist/review/local-review-backend.d.ts.map +0 -1
- package/dist/review/local-reviews.d.ts +0 -31
- package/dist/review/local-reviews.d.ts.map +0 -1
- package/dist/review/review-markdown.d.ts +0 -6
- package/dist/review/review-markdown.d.ts.map +0 -1
- package/skills/plan/references/workflows/annotate.md +0 -13
- package/skills/review/references/workflows/open.md +0 -11
|
@@ -2,20 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
## Parse arguments
|
|
4
4
|
|
|
5
|
-
Accept `new [title] [--intent text] [--base branch] [--local]
|
|
5
|
+
Accept `new [title] [--intent text] [--base branch] [--local]`. Resolve explicit target, plan/ticket, title, and backend first. For local work, ask `ask_user_question` when multiple plans or tickets match; do not guess.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Local steps
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Use a background `diffpi-worker` when native subagents are available; otherwise follow the foreground fallback after confirmation. The worker performs only direct-file creation.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
- This explicitly assigned review-draft creation is the only review lifecycle mutation authorized here. Call review_context first. Reuse its target/backend/local/cwd for all subsequent calls; never switch backend silently.
|
|
16
|
-
- Reject unsupported forge, dirty remote branch or unavailable local base/default with exact evidence.
|
|
17
|
-
- Call review_new to create the local tuicr review or remote draft PR/MR. Call review_launch_ui only if needed; report a returned launch command if automatic launch fails.
|
|
18
|
-
- Verify and report the actual created target and draft state or exact failure. Do not stage findings, publish, complete or merge.
|
|
19
|
-
```
|
|
11
|
+
1. Inspect `.diffpi/review/` and the matching plan/ticket directory before choosing a number. Derive `YYMMDD-{slug}` from the unique matching plan after stripping its date prefix, otherwise the ticket ID, otherwise a descriptive slug.
|
|
12
|
+
2. Create `.diffpi/review/YYMMDD-{slug}/REVIEW-{n}.md` by reading `templates/REVIEW.md` and writing a copy. Numbering is best effort, not atomic; preserve existing files.
|
|
13
|
+
3. Fill every known title, intent, target, base, and status field. If review text was pasted in the request, record it directly in the file and assign stable `F-001`-style IDs. Preserve replies and checkbox state on later edits.
|
|
14
|
+
4. Report the exact path. Do not call `review_new`, create a backend, or claim atomic allocation.
|
|
20
15
|
|
|
21
|
-
|
|
16
|
+
## Remote steps
|
|
17
|
+
|
|
18
|
+
Call `review_context`, then launch a `diffpi-worker` only for draft creation. Give the worker the resolved repository, branch, base, issue URL (if any), and exact request. The worker must:
|
|
19
|
+
|
|
20
|
+
1. Read the packaged PR template at `../../templates/review/draft-pr.md` relative to the review skill directory. Inspect the actual branch changes against the selected base and any completed checks; do not invent validation results.
|
|
21
|
+
2. Fill **every** template section: distinct intent and concrete changes, checks actually run (or `Not run (draft)`), the issue URL (or `No linked issue`), and known further work (or `Not yet assessed`). Remove all `{{...}}` markers and HTML comments. Pass the fully rendered Markdown as `body` to the existing `review_new` tool, with the resolved title/base/issue URL. The tool rejects missing or incomplete bodies before calling the forge.
|
|
22
|
+
3. Report the actual PR/MR URL and draft state or the precise failure. Do not publish, complete, merge, or stage findings.
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
## Parse arguments
|
|
4
4
|
|
|
5
|
-
Accept `publish [target] [--
|
|
5
|
+
Accept `publish [target] [--comment|--approve|--request-changes|--close]`. Local publish is unsupported; reject stale `--local` or working-tree selectors. Fuzzy-match target/backend/status from the request and repository. Prefer explicit arguments/flags, then safe inference, then current-review target and comment status. Call `ask_user_question` only for material ambiguity before launch; return a precise blocker if a new decision arises later.
|
|
6
6
|
|
|
7
7
|
## Steps
|
|
8
8
|
|
|
9
|
-
1. Call `review_context` first with the selected target/backend
|
|
9
|
+
1. Call `review_context` first with the selected remote target/backend and `local:false`. For a short, explicitly approved publication with no substantive inspection, call `review_publish` directly using its resolved values and selected status (`COMMENT` by default, `APPROVE`, `REQUEST_CHANGES`, or `CLOSE`). Remote findings and replies stay pending until this call. Reject stale local or working-tree selectors; never promote local drafts. Report unmatched promotion, GitLab request-changes rejection, and exact failures; verify the final status. Do not merge or resolve threads.
|
|
10
10
|
2. If the request instead needs substantive inspection or judgment before publication, when native subagents are available, delegate only that analysis to medium `diffpi-orchestrator` in the background with ambient capabilities. Fill every field in this self-contained prompt with actual values (or `none`), including the exact request; never send raw placeholders:
|
|
11
11
|
|
|
12
12
|
```text
|
|
@@ -7,4 +7,4 @@ Accept `status [target] [--local]`. Fuzzy-match the status target/backend from t
|
|
|
7
7
|
## Steps
|
|
8
8
|
|
|
9
9
|
1. Call `review_context` first with the selected target/backend/local; reuse its target/backend/local/cwd. Reject unsupported selections without switching backend.
|
|
10
|
-
2. Call `review_status` with those same values. Report branch, worktree, local or remote review, URLs,
|
|
10
|
+
2. Call `review_status` with those same values. Report branch, worktree, local or remote review, URLs, pending/draft state and exact errors. Do not create a review or mutate source, comments or lifecycle state.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Local Review
|
|
2
|
+
|
|
3
|
+
- **Review:** <!-- descriptive title or plan/ticket slug -->
|
|
4
|
+
- **Status:** OPEN
|
|
5
|
+
- **Source:** <!-- pasted review text, local diff, or request -->
|
|
6
|
+
- **Created:** <!-- YYYY-MM-DD -->
|
|
7
|
+
- **Updated:** <!-- YYYY-MM-DD -->
|
|
8
|
+
|
|
9
|
+
## Intent
|
|
10
|
+
|
|
11
|
+
<!-- State what this review is checking. -->
|
|
12
|
+
|
|
13
|
+
## Findings
|
|
14
|
+
|
|
15
|
+
<!-- Keep findings in stable ID order. Preserve IDs, replies, and checkbox state when editing. -->
|
|
16
|
+
|
|
17
|
+
### F-001 [ ] <!-- short finding title -->
|
|
18
|
+
|
|
19
|
+
- **Severity:** BLOCKING | CONSIDER | NOTE
|
|
20
|
+
- **Location:** `path/to/file.ts:1`
|
|
21
|
+
- **Finding:** <!-- Explain the problem and its impact. -->
|
|
22
|
+
- **Evidence:** <!-- Quote the relevant source or review text. -->
|
|
23
|
+
- **Resolution:** <!-- Leave blank while open; record the verified fix here. -->
|
|
24
|
+
|
|
25
|
+
<!-- Copy the finding shape above for F-002, F-003, and so on. -->
|
|
26
|
+
|
|
27
|
+
## Replies
|
|
28
|
+
|
|
29
|
+
<!-- Preserve human replies verbatim. Add dated replies below without deleting prior context. -->
|
|
30
|
+
|
|
31
|
+
## Verification
|
|
32
|
+
|
|
33
|
+
- [ ] Focused check run for each addressed finding
|
|
34
|
+
- [ ] Remaining open findings reviewed
|
|
35
|
+
- [ ] Overall status updated only after verification
|
|
36
|
+
|
|
37
|
+
## Status Notes
|
|
38
|
+
|
|
39
|
+
<!-- Record blockers, partial work, and decisions. Do not close a finding without evidence. -->
|
package/templates/plan/PLAN.md
CHANGED
|
@@ -3,8 +3,12 @@
|
|
|
3
3
|
- **Plan ID:** {{id}}
|
|
4
4
|
- **Branch:** {{branch}}
|
|
5
5
|
- **Status:** draft
|
|
6
|
+
- **Execution state:** inactive
|
|
7
|
+
- **Execution worktree:** None
|
|
8
|
+
- **Execution reason:** None
|
|
6
9
|
- **Issue:** {{issue_id}}
|
|
7
10
|
- **Issue URL:** {{issue_url}}
|
|
11
|
+
- **Revision:** 0
|
|
8
12
|
|
|
9
13
|
## Intent
|
|
10
14
|
|
|
@@ -44,4 +48,8 @@
|
|
|
44
48
|
|
|
45
49
|
## References
|
|
46
50
|
|
|
47
|
-
<!-- Add repository or external references
|
|
51
|
+
<!-- Add repository or external references before Feedback. -->
|
|
52
|
+
|
|
53
|
+
### Feedback
|
|
54
|
+
|
|
55
|
+
<!-- Capture pending user feedback before an update. Archive the complete plan and numbered briefs before substantive edits, then increment Revision exactly once and address or disposition the feedback. -->
|
|
@@ -4,22 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
## Changes
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
{{changes}}
|
|
8
8
|
|
|
9
9
|
## Validation
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
- [ ] Existing tests pass
|
|
11
|
+
{{validation}}
|
|
14
12
|
|
|
15
13
|
## References
|
|
16
14
|
|
|
17
|
-
<!-- Link the issue that defines this task. Add related project, epic, and public documentation links when available. -->
|
|
18
|
-
|
|
19
15
|
- Issue: {{issue_url}}
|
|
20
16
|
|
|
21
17
|
## Further Work
|
|
22
18
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
-
|
|
19
|
+
{{further_work}}
|
package/dist/cli/plan.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
export interface PlanCliIO {
|
|
3
|
-
stdout: Pick<NodeJS.WriteStream, 'write'>;
|
|
4
|
-
stderr: Pick<NodeJS.WriteStream, 'write'>;
|
|
5
|
-
}
|
|
6
|
-
interface PlanCliRuntime {
|
|
7
|
-
execute: (command: string, args: string[], cwd: string, interactive: boolean) => Promise<{
|
|
8
|
-
code: number;
|
|
9
|
-
stdout: string;
|
|
10
|
-
stderr: string;
|
|
11
|
-
}>;
|
|
12
|
-
}
|
|
13
|
-
export declare function createPlanCliCommand(io?: PlanCliIO, planRuntime?: PlanCliRuntime): Command;
|
|
14
|
-
export declare function runPlanCli(args: string[], io?: PlanCliIO): Promise<number>;
|
|
15
|
-
export declare function planCliHelp(): string;
|
|
16
|
-
export {};
|
|
17
|
-
//# sourceMappingURL=plan.d.ts.map
|
package/dist/cli/plan.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/dist/cli.d.ts
DELETED
package/dist/cli.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAGA,OAAO,EAAwB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAElE,wBAAsB,IAAI,CAAC,IAAI,WAAwB,EAAE,EAAE,GAAE,SAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,CAkBjG"}
|