opencode-codegraph 0.1.24 → 0.1.25

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,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.25 - 2026-03-21
4
+
5
+ - append full workflow guidance alongside post-commit review summaries so commit-time output matches the normalized status contract more closely
6
+
3
7
  ## 0.1.24 - 2026-03-20
4
8
 
5
9
  - surface workflow-state transitions after later bash interactions so async state changes become visible without waiting for explicit status checks
package/README.md CHANGED
@@ -54,7 +54,7 @@ Every conversation includes:
54
54
 
55
55
  ### Post-Commit Updates
56
56
 
57
- 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 structured post-commit block with:
57
+ 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 structured post-commit block plus the current workflow guidance with:
58
58
 
59
59
  - what changed in the review trace
60
60
  - why it matters
@@ -120,9 +120,18 @@ Place in `.opencode/commands/`:
120
120
  | generic `tool.execute.after` | Surface workflow-state transitions after other bash commands when the underlying state changes |
121
121
  | `codegraph_review` tool | Returns review results together with current workflow guidance and suggested follow-up command |
122
122
  | `experimental.session.compacting` | Preserve current dogfooding status when OpenCode compacts long sessions |
123
- | `command.execute.before` | Inject current dogfooding status into `/review`, `/audit`, `/update`, `/status`, and `/next` |
123
+ | `command.execute.before` | Inject current dogfooding status into `/review`, `/audit`, `/update`, `/status`, `/next`, `/continue`, `/maintain-db`, and `/unlock-db` |
124
124
  | `db_locked` recovery path | Surface lock-holder-aware recovery guidance when DuckDB is blocked by another process |
125
125
  | `permission.ask` | Auto-allow `codegraph_*` tools |
126
+
127
+ Across status-oriented surfaces, the plugin is converging on one shared summary contract:
128
+
129
+ - workflow state
130
+ - blockers
131
+ - warnings
132
+ - what improved
133
+ - still blocked
134
+ - recommended command
126
135
 
127
136
  ## License
128
137
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-codegraph",
3
- "version": "0.1.24",
3
+ "version": "0.1.25",
4
4
  "description": "OpenCode plugin for CodeGraph CPG-powered code analysis",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
package/src/index.ts CHANGED
@@ -135,7 +135,7 @@ const codegraphPlugin: Plugin = async (input) => {
135
135
  // 1c. Command execution: inject current dogfooding status into guided commands
136
136
  // -----------------------------------------------------------------
137
137
  "command.execute.before": async (inp, output) => {
138
- if (!["review", "audit", "update", "status", "next"].includes(inp.command)) {
138
+ if (!["review", "audit", "update", "status", "next", "continue", "maintain-db", "unlock-db"].includes(inp.command)) {
139
139
  return
140
140
  }
141
141
 
@@ -177,7 +177,7 @@ const codegraphPlugin: Plugin = async (input) => {
177
177
  const editIntent = messageSuggestsEditing(output.parts)
178
178
  const workflowIntent = messageSuggestsWorkflowGuidance(output.parts)
179
179
 
180
- if (!files.length && !workflowIntent) return
180
+ if (!files.length && !workflowIntent && !pendingReviewCommit) return
181
181
 
182
182
  try {
183
183
  const pendingUpdate = await consumePendingReviewTraceUpdate()
@@ -320,6 +320,7 @@ const codegraphPlugin: Plugin = async (input) => {
320
320
  await api.triggerIncrementalUpdate(projectId, directory)
321
321
 
322
322
  let traceSummary: string | null = null
323
+ let workflowGuidance: string | null = null
323
324
  if (commit) {
324
325
  const traceSnapshot = await readReviewTraceSnapshot(directory, commit)
325
326
  if (traceSnapshot) {
@@ -362,17 +363,27 @@ const codegraphPlugin: Plugin = async (input) => {
362
363
  }
363
364
  }
364
365
 
366
+ try {
367
+ const rawStatus = await $`python -m src.cli.import_commands dogfood status --json`.quiet().text()
368
+ const status = JSON.parse(rawStatus)
369
+ workflowGuidance = formatWorkflowGuidanceBlock(status)
370
+ } catch {
371
+ // keep commit flow resilient if unified status is unavailable
372
+ }
373
+
365
374
  // Notify user via output metadata (visible in OpenCode UI)
366
- output.title = traceSummary
375
+ output.title = traceSummary || workflowGuidance
367
376
  ? "CodeGraph: post-commit review summary ready"
368
377
  : "CodeGraph: CPG update triggered"
369
378
  output.metadata = {
370
379
  ...output.metadata,
371
380
  codegraph_cpg_update: "triggered",
372
381
  }
373
- if (traceSummary) {
382
+ if (traceSummary || workflowGuidance) {
374
383
  const existingOutput = output.output?.trimEnd() || ""
375
- output.output = existingOutput ? `${existingOutput}\n\n${traceSummary}` : traceSummary
384
+ output.output = [existingOutput, traceSummary || "", workflowGuidance || ""]
385
+ .filter(Boolean)
386
+ .join("\n\n")
376
387
  }
377
388
  } catch {
378
389
  // Best-effort — don't break the workflow
package/src/util.ts CHANGED
@@ -43,6 +43,13 @@ export type DogfoodStatusSnapshot = {
43
43
  workflow_state?: string
44
44
  recommended_next_action?: string
45
45
  recommended_command?: string
46
+ blockers?: string[]
47
+ warnings?: string[]
48
+ closure?: {
49
+ what_improved?: string
50
+ still_blocked?: string
51
+ before_push?: string
52
+ }
46
53
  }
47
54
 
48
55
  /**
@@ -397,6 +404,9 @@ export function formatDogfoodStatusSummary(snapshot: DogfoodStatusSnapshot): str
397
404
  const workflowState = snapshot.workflow_state
398
405
  const nextAction = snapshot.recommended_next_action
399
406
  const nextCommand = (snapshot as { recommended_command?: string }).recommended_command
407
+ const blockers = Array.isArray(snapshot.blockers) ? snapshot.blockers.filter(Boolean) : []
408
+ const warnings = Array.isArray(snapshot.warnings) ? snapshot.warnings.filter(Boolean) : []
409
+ const closure = snapshot.closure || {}
400
410
 
401
411
  if (typeof isFresh === "undefined" && !headCommit && !nextAction) {
402
412
  return null
@@ -432,6 +442,21 @@ export function formatDogfoodStatusSummary(snapshot: DogfoodStatusSnapshot): str
432
442
  if (nextCommand) {
433
443
  lines.push(`- Suggested command: ${nextCommand}`)
434
444
  }
445
+ if (blockers.length) {
446
+ lines.push(`- Blockers: ${blockers.join("; ")}`)
447
+ }
448
+ if (warnings.length) {
449
+ lines.push(`- Warnings: ${warnings.join("; ")}`)
450
+ }
451
+ if (closure.what_improved) {
452
+ lines.push(`- What improved: ${closure.what_improved}`)
453
+ }
454
+ if (closure.still_blocked) {
455
+ lines.push(`- Still blocked: ${closure.still_blocked}`)
456
+ }
457
+ if (closure.before_push) {
458
+ lines.push(`- Before push: ${closure.before_push}`)
459
+ }
435
460
  return lines.join("\n")
436
461
  }
437
462
 
@@ -439,8 +464,11 @@ export function formatWorkflowGuidanceBlock(snapshot: DogfoodStatusSnapshot): st
439
464
  const workflowState = snapshot.workflow_state
440
465
  const nextAction = snapshot.recommended_next_action
441
466
  const nextCommand = snapshot.recommended_command
467
+ const blockers = Array.isArray(snapshot.blockers) ? snapshot.blockers.filter(Boolean) : []
468
+ const warnings = Array.isArray(snapshot.warnings) ? snapshot.warnings.filter(Boolean) : []
469
+ const closure = snapshot.closure || {}
442
470
 
443
- if (!workflowState && !nextAction && !nextCommand) {
471
+ if (!workflowState && !nextAction && !nextCommand && !blockers.length && !warnings.length) {
444
472
  return null
445
473
  }
446
474
 
@@ -454,6 +482,21 @@ export function formatWorkflowGuidanceBlock(snapshot: DogfoodStatusSnapshot): st
454
482
  if (nextCommand) {
455
483
  lines.push(`- Suggested command: ${nextCommand}`)
456
484
  }
485
+ if (blockers.length) {
486
+ lines.push(`- Blockers: ${blockers.join("; ")}`)
487
+ }
488
+ if (warnings.length) {
489
+ lines.push(`- Warnings: ${warnings.join("; ")}`)
490
+ }
491
+ if (closure.what_improved) {
492
+ lines.push(`- What improved: ${closure.what_improved}`)
493
+ }
494
+ if (closure.still_blocked) {
495
+ lines.push(`- Still blocked: ${closure.still_blocked}`)
496
+ }
497
+ if (closure.before_push) {
498
+ lines.push(`- Before push: ${closure.before_push}`)
499
+ }
457
500
  return lines.join("\n")
458
501
  }
459
502
 
@@ -510,6 +553,24 @@ export function formatAfterTestGuidance(
510
553
  if (nextCommand) {
511
554
  lines.push(`- Suggested command: ${nextCommand}`)
512
555
  }
556
+ const blockers = Array.isArray(snapshot.blockers) ? snapshot.blockers.filter(Boolean) : []
557
+ const warnings = Array.isArray(snapshot.warnings) ? snapshot.warnings.filter(Boolean) : []
558
+ const closure = snapshot.closure || {}
559
+ if (blockers.length) {
560
+ lines.push(`- Blockers: ${blockers.join("; ")}`)
561
+ }
562
+ if (warnings.length) {
563
+ lines.push(`- Warnings: ${warnings.join("; ")}`)
564
+ }
565
+ if (closure.what_improved) {
566
+ lines.push(`- What improved: ${closure.what_improved}`)
567
+ }
568
+ if (closure.still_blocked) {
569
+ lines.push(`- Still blocked: ${closure.still_blocked}`)
570
+ }
571
+ if (closure.before_push) {
572
+ lines.push(`- Before push: ${closure.before_push}`)
573
+ }
513
574
  return lines.join("\n")
514
575
  }
515
576