opencode-codegraph 0.1.4 → 0.1.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.5 - 2026-03-20
4
+
5
+ - add unified next-action summary to review-trace status output
6
+ - surface next-action guidance in post-commit OpenCode plugin metadata and review-trace summaries
7
+ - document the next-action workflow in plugin and integration docs
8
+
3
9
  ## 0.1.4 - 2026-03-20
4
10
 
5
11
  - add conversational pre-edit guidance when a chat message suggests code modification
package/README.md CHANGED
@@ -45,7 +45,7 @@ Every conversation includes a project summary with file count, top complexity ho
45
45
 
46
46
  ### Post-Commit Updates
47
47
 
48
- After `git commit`, the plugin triggers incremental CPG re-parsing via GoCPG and syncs the ChromaDB vector store. If durable review-trace artifacts exist for the new `HEAD`, the plugin also appends a short review-trace summary with findings and recommendations.
48
+ After `git commit`, the plugin triggers incremental CPG re-parsing via GoCPG and syncs the ChromaDB vector store. If durable review-trace artifacts exist for the new `HEAD`, the plugin also appends a short review-trace summary with findings, recommendations, and a single next action to take.
49
49
 
50
50
  ### Custom Tools
51
51
 
@@ -89,7 +89,7 @@ Place in `.opencode/commands/`:
89
89
  | `experimental.chat.system.transform` | Inject project summary into system prompt |
90
90
  | `chat.message` | Add CPG context for mentioned files |
91
91
  | `chat.message` (edit intent) | Add pre-edit warnings for files likely to be modified |
92
- | `tool.execute.after` | Trigger CPG update after git commit |
92
+ | `tool.execute.after` | Trigger CPG update after git commit and append review-trace summary with next action |
93
93
  | `permission.ask` | Auto-allow `codegraph_*` tools |
94
94
 
95
95
  ## License
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "opencode-codegraph",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "OpenCode plugin for CodeGraph CPG-powered code analysis",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
7
7
  "exports": {
8
8
  ".": "./src/index.ts"
9
9
  },
10
- "files": [
11
- "src",
12
- "CHANGELOG.md"
13
- ],
10
+ "files": [
11
+ "src",
12
+ "CHANGELOG.md"
13
+ ],
14
14
  "scripts": {
15
15
  "typecheck": "tsc --noEmit",
16
16
  "build": "tsc"
package/src/index.ts CHANGED
@@ -21,6 +21,7 @@ import {
21
21
  getHeadCommit,
22
22
  isGitCommit,
23
23
  messageSuggestsEditing,
24
+ recommendedNextActionFromReviewTrace,
24
25
  readReviewTraceSnapshot,
25
26
  } from "./util"
26
27
 
@@ -112,6 +113,7 @@ const codegraphPlugin: Plugin = async (input) => {
112
113
  codegraph_review_trace_findings: traceSnapshot.review_findings_count ?? null,
113
114
  codegraph_review_trace_recommendations:
114
115
  traceSnapshot.review_recommendations?.slice(0, 3) || [],
116
+ codegraph_review_trace_next_action: recommendedNextActionFromReviewTrace(traceSnapshot),
115
117
  }
116
118
  }
117
119
  }
package/src/util.ts CHANGED
@@ -163,9 +163,39 @@ export function formatReviewTraceSummary(snapshot: ReviewTraceSnapshot): string
163
163
  }
164
164
  }
165
165
 
166
+ const nextAction = recommendedNextActionFromReviewTrace(snapshot)
167
+ if (nextAction) {
168
+ lines.push("", `**Next action:** ${nextAction}`)
169
+ }
170
+
166
171
  return lines.length > 2 ? lines.join("\n") : null
167
172
  }
168
173
 
174
+ export function recommendedNextActionFromReviewTrace(snapshot: ReviewTraceSnapshot): string {
175
+ const status = (snapshot.status || "").toLowerCase()
176
+ const findingsCount = snapshot.review_findings_count
177
+ const recommendations = Array.isArray(snapshot.review_recommendations)
178
+ ? snapshot.review_recommendations.filter(Boolean)
179
+ : []
180
+
181
+ if (snapshot.error) {
182
+ return "Investigate the review-trace error, then run /review once the pipeline is healthy."
183
+ }
184
+ if (status === "running") {
185
+ return "Wait for review trace completion, then inspect findings and recommendations."
186
+ }
187
+ if (status && status !== "completed") {
188
+ return "Check the latest review trace status again and rerun /review if the result is incomplete."
189
+ }
190
+ if (typeof findingsCount === "number" && findingsCount > 0) {
191
+ if (recommendations.length) {
192
+ return "Apply the top CodeGraph recommendations, then run /review to confirm the fixes."
193
+ }
194
+ return "Inspect the reported findings, fix the highest-risk issues, then run /review again."
195
+ }
196
+ return "No review findings recorded; continue with /review or push once the rest of your checks are green."
197
+ }
198
+
169
199
  // File extensions recognized as source code
170
200
  const SOURCE_EXTENSIONS = new Set([
171
201
  "py",