opencode-codegraph 0.1.24 → 0.1.26

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,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.26 - 2026-03-21
4
+
5
+ - include lock holders, recovery steps, and maintenance action details directly in plugin workflow summaries
6
+
7
+ ## 0.1.25 - 2026-03-21
8
+
9
+ - append full workflow guidance alongside post-commit review summaries so commit-time output matches the normalized status contract more closely
10
+
3
11
  ## 0.1.24 - 2026-03-20
4
12
 
5
13
  - 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,19 @@ 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
135
+ - lock holders / recovery steps when DuckDB is blocked
126
136
 
127
137
  ## License
128
138
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-codegraph",
3
- "version": "0.1.24",
3
+ "version": "0.1.26",
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
@@ -39,10 +39,22 @@ export type DogfoodStatusSnapshot = {
39
39
  db_size_mb?: number
40
40
  recommended_action?: string
41
41
  }
42
+ db_lock?: {
43
+ locked?: boolean
44
+ holders?: string[]
45
+ recovery?: string[]
46
+ }
42
47
  review_trace?: ReviewTraceSnapshot | null
43
48
  workflow_state?: string
44
49
  recommended_next_action?: string
45
50
  recommended_command?: string
51
+ blockers?: string[]
52
+ warnings?: string[]
53
+ closure?: {
54
+ what_improved?: string
55
+ still_blocked?: string
56
+ before_push?: string
57
+ }
46
58
  }
47
59
 
48
60
  /**
@@ -393,10 +405,14 @@ export function formatDogfoodStatusSummary(snapshot: DogfoodStatusSnapshot): str
393
405
  const worktreeClean = git.worktree_clean
394
406
  const reviewTrace = snapshot.review_trace || null
395
407
  const maintenance = snapshot.db_maintenance || null
408
+ const dbLock = snapshot.db_lock || null
396
409
  const traceStatus = reviewTrace?.status || "missing"
397
410
  const workflowState = snapshot.workflow_state
398
411
  const nextAction = snapshot.recommended_next_action
399
412
  const nextCommand = (snapshot as { recommended_command?: string }).recommended_command
413
+ const blockers = Array.isArray(snapshot.blockers) ? snapshot.blockers.filter(Boolean) : []
414
+ const warnings = Array.isArray(snapshot.warnings) ? snapshot.warnings.filter(Boolean) : []
415
+ const closure = snapshot.closure || {}
400
416
 
401
417
  if (typeof isFresh === "undefined" && !headCommit && !nextAction) {
402
418
  return null
@@ -421,6 +437,19 @@ export function formatDogfoodStatusSummary(snapshot: DogfoodStatusSnapshot): str
421
437
  lines.push(
422
438
  `- DB maintenance: ${maintenance.due ? "due" : "ok"} (${maintenance.reason || "unknown"}${typeof maintenance.db_size_mb === "number" ? `, ${maintenance.db_size_mb} MB` : ""})`,
423
439
  )
440
+ if (maintenance.recommended_action) {
441
+ lines.push(`- DB maintenance action: ${maintenance.recommended_action}`)
442
+ }
443
+ }
444
+ if (dbLock?.locked) {
445
+ const holders = Array.isArray(dbLock.holders) ? dbLock.holders.filter(Boolean) : []
446
+ const recovery = Array.isArray(dbLock.recovery) ? dbLock.recovery.filter(Boolean) : []
447
+ if (holders.length) {
448
+ lines.push(`- DB lock holders: ${holders.join("; ")}`)
449
+ }
450
+ if (recovery.length) {
451
+ lines.push(`- DB lock recovery: ${recovery.join("; ")}`)
452
+ }
424
453
  }
425
454
  lines.push(`- Review trace: ${traceStatus}`)
426
455
  if (workflowState) {
@@ -432,6 +461,21 @@ export function formatDogfoodStatusSummary(snapshot: DogfoodStatusSnapshot): str
432
461
  if (nextCommand) {
433
462
  lines.push(`- Suggested command: ${nextCommand}`)
434
463
  }
464
+ if (blockers.length) {
465
+ lines.push(`- Blockers: ${blockers.join("; ")}`)
466
+ }
467
+ if (warnings.length) {
468
+ lines.push(`- Warnings: ${warnings.join("; ")}`)
469
+ }
470
+ if (closure.what_improved) {
471
+ lines.push(`- What improved: ${closure.what_improved}`)
472
+ }
473
+ if (closure.still_blocked) {
474
+ lines.push(`- Still blocked: ${closure.still_blocked}`)
475
+ }
476
+ if (closure.before_push) {
477
+ lines.push(`- Before push: ${closure.before_push}`)
478
+ }
435
479
  return lines.join("\n")
436
480
  }
437
481
 
@@ -439,8 +483,13 @@ export function formatWorkflowGuidanceBlock(snapshot: DogfoodStatusSnapshot): st
439
483
  const workflowState = snapshot.workflow_state
440
484
  const nextAction = snapshot.recommended_next_action
441
485
  const nextCommand = snapshot.recommended_command
486
+ const blockers = Array.isArray(snapshot.blockers) ? snapshot.blockers.filter(Boolean) : []
487
+ const warnings = Array.isArray(snapshot.warnings) ? snapshot.warnings.filter(Boolean) : []
488
+ const closure = snapshot.closure || {}
489
+ const dbLock = snapshot.db_lock || null
490
+ const maintenance = snapshot.db_maintenance || null
442
491
 
443
- if (!workflowState && !nextAction && !nextCommand) {
492
+ if (!workflowState && !nextAction && !nextCommand && !blockers.length && !warnings.length) {
444
493
  return null
445
494
  }
446
495
 
@@ -454,6 +503,34 @@ export function formatWorkflowGuidanceBlock(snapshot: DogfoodStatusSnapshot): st
454
503
  if (nextCommand) {
455
504
  lines.push(`- Suggested command: ${nextCommand}`)
456
505
  }
506
+ if (blockers.length) {
507
+ lines.push(`- Blockers: ${blockers.join("; ")}`)
508
+ }
509
+ if (warnings.length) {
510
+ lines.push(`- Warnings: ${warnings.join("; ")}`)
511
+ }
512
+ if (closure.what_improved) {
513
+ lines.push(`- What improved: ${closure.what_improved}`)
514
+ }
515
+ if (closure.still_blocked) {
516
+ lines.push(`- Still blocked: ${closure.still_blocked}`)
517
+ }
518
+ if (closure.before_push) {
519
+ lines.push(`- Before push: ${closure.before_push}`)
520
+ }
521
+ if (maintenance?.recommended_action) {
522
+ lines.push(`- Maintenance action: ${maintenance.recommended_action}`)
523
+ }
524
+ if (dbLock?.locked) {
525
+ const holders = Array.isArray(dbLock.holders) ? dbLock.holders.filter(Boolean) : []
526
+ const recovery = Array.isArray(dbLock.recovery) ? dbLock.recovery.filter(Boolean) : []
527
+ if (holders.length) {
528
+ lines.push(`- Lock holders: ${holders.join("; ")}`)
529
+ }
530
+ if (recovery.length) {
531
+ lines.push(`- Lock recovery: ${recovery.join("; ")}`)
532
+ }
533
+ }
457
534
  return lines.join("\n")
458
535
  }
459
536
 
@@ -510,6 +587,24 @@ export function formatAfterTestGuidance(
510
587
  if (nextCommand) {
511
588
  lines.push(`- Suggested command: ${nextCommand}`)
512
589
  }
590
+ const blockers = Array.isArray(snapshot.blockers) ? snapshot.blockers.filter(Boolean) : []
591
+ const warnings = Array.isArray(snapshot.warnings) ? snapshot.warnings.filter(Boolean) : []
592
+ const closure = snapshot.closure || {}
593
+ if (blockers.length) {
594
+ lines.push(`- Blockers: ${blockers.join("; ")}`)
595
+ }
596
+ if (warnings.length) {
597
+ lines.push(`- Warnings: ${warnings.join("; ")}`)
598
+ }
599
+ if (closure.what_improved) {
600
+ lines.push(`- What improved: ${closure.what_improved}`)
601
+ }
602
+ if (closure.still_blocked) {
603
+ lines.push(`- Still blocked: ${closure.still_blocked}`)
604
+ }
605
+ if (closure.before_push) {
606
+ lines.push(`- Before push: ${closure.before_push}`)
607
+ }
513
608
  return lines.join("\n")
514
609
  }
515
610