opencode-codegraph 0.1.25 → 0.1.28

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,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.28 - 2026-03-21
4
+
5
+ - surface primary issue and recovery sequence in plugin workflow summaries so competing blockers are shown in a prioritized order
6
+
7
+ ## 0.1.27 - 2026-03-21
8
+
9
+ - surface primary issue and recovery sequence in plugin workflow summaries so competing states are presented in a prioritized order
10
+
11
+ ## 0.1.26 - 2026-03-21
12
+
13
+ - include lock holders, recovery steps, and maintenance action details directly in plugin workflow summaries
14
+
3
15
  ## 0.1.25 - 2026-03-21
4
16
 
5
17
  - append full workflow guidance alongside post-commit review summaries so commit-time output matches the normalized status contract more closely
package/README.md CHANGED
@@ -115,7 +115,7 @@ Place in `.opencode/commands/`:
115
115
  | `chat.message` (edit intent) | Add pre-edit warnings for files likely to be modified |
116
116
  | `chat.message` (workflow intent) | Add dogfooding status when the user asks what to do next |
117
117
  | `tool.execute.after` on test commands | Add after-test workflow guidance and detect failed test runs before suggesting the next command |
118
- | `tool.execute.after` on `git status` / `git diff` | Add current workflow guidance directly to common git inspection commands |
118
+ | `tool.execute.after` on `git status` / `git diff` | Add the same normalized workflow guidance block used by other status-oriented surfaces |
119
119
  | `tool.execute.after` | Trigger CPG update after git commit and append structured post-commit review summary |
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 |
@@ -132,6 +132,7 @@ Across status-oriented surfaces, the plugin is converging on one shared summary
132
132
  - what improved
133
133
  - still blocked
134
134
  - recommended command
135
+ - lock holders / recovery steps when DuckDB is blocked
135
136
 
136
137
  ## License
137
138
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-codegraph",
3
- "version": "0.1.25",
3
+ "version": "0.1.28",
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
@@ -280,7 +280,7 @@ const codegraphPlugin: Plugin = async (input) => {
280
280
  const rawStatus = await $`python -m src.cli.import_commands dogfood status --json`.quiet().text()
281
281
  const status = JSON.parse(rawStatus)
282
282
  const transition = workflowTransition(status)
283
- const guidance = formatDogfoodStatusSummary(status)
283
+ const guidance = formatWorkflowGuidanceBlock(status)
284
284
  if (guidance) {
285
285
  output.title = "CodeGraph: git workflow guidance ready"
286
286
  const existingOutput = output.output?.trimEnd() || ""
package/src/util.ts CHANGED
@@ -39,10 +39,17 @@ 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
+ primary_issue?: string
52
+ recovery_sequence?: string[]
46
53
  blockers?: string[]
47
54
  warnings?: string[]
48
55
  closure?: {
@@ -51,6 +58,67 @@ export type DogfoodStatusSnapshot = {
51
58
  before_push?: string
52
59
  }
53
60
  }
61
+
62
+ function workflowSummaryLines(snapshot: DogfoodStatusSnapshot): string[] {
63
+ const workflowState = snapshot.workflow_state
64
+ const nextAction = snapshot.recommended_next_action
65
+ const nextCommand = snapshot.recommended_command
66
+ const primaryIssue = snapshot.primary_issue
67
+ const recoverySequence = Array.isArray(snapshot.recovery_sequence)
68
+ ? snapshot.recovery_sequence.filter(Boolean)
69
+ : []
70
+ const blockers = Array.isArray(snapshot.blockers) ? snapshot.blockers.filter(Boolean) : []
71
+ const warnings = Array.isArray(snapshot.warnings) ? snapshot.warnings.filter(Boolean) : []
72
+ const closure = snapshot.closure || {}
73
+ const dbLock = snapshot.db_lock || null
74
+ const maintenance = snapshot.db_maintenance || null
75
+
76
+ const lines: string[] = []
77
+ if (workflowState) {
78
+ lines.push(`- Workflow state: ${workflowState}`)
79
+ }
80
+ if (nextAction) {
81
+ lines.push(`- Next action: ${nextAction}`)
82
+ }
83
+ if (nextCommand) {
84
+ lines.push(`- Suggested command: ${nextCommand}`)
85
+ }
86
+ if (primaryIssue) {
87
+ lines.push(`- Primary issue: ${primaryIssue}`)
88
+ }
89
+ if (recoverySequence.length) {
90
+ lines.push(`- Recovery sequence: ${recoverySequence.join(" -> ")}`)
91
+ }
92
+ if (blockers.length) {
93
+ lines.push(`- Blockers: ${blockers.join("; ")}`)
94
+ }
95
+ if (warnings.length) {
96
+ lines.push(`- Warnings: ${warnings.join("; ")}`)
97
+ }
98
+ if (closure.what_improved) {
99
+ lines.push(`- What improved: ${closure.what_improved}`)
100
+ }
101
+ if (closure.still_blocked) {
102
+ lines.push(`- Still blocked: ${closure.still_blocked}`)
103
+ }
104
+ if (closure.before_push) {
105
+ lines.push(`- Before push: ${closure.before_push}`)
106
+ }
107
+ if (maintenance?.recommended_action) {
108
+ lines.push(`- Maintenance action: ${maintenance.recommended_action}`)
109
+ }
110
+ if (dbLock?.locked) {
111
+ const holders = Array.isArray(dbLock.holders) ? dbLock.holders.filter(Boolean) : []
112
+ const recovery = Array.isArray(dbLock.recovery) ? dbLock.recovery.filter(Boolean) : []
113
+ if (holders.length) {
114
+ lines.push(`- Lock holders: ${holders.join("; ")}`)
115
+ }
116
+ if (recovery.length) {
117
+ lines.push(`- Lock recovery: ${recovery.join("; ")}`)
118
+ }
119
+ }
120
+ return lines
121
+ }
54
122
 
55
123
  /**
56
124
  * Extract file references from message parts.
@@ -400,15 +468,11 @@ export function formatDogfoodStatusSummary(snapshot: DogfoodStatusSnapshot): str
400
468
  const worktreeClean = git.worktree_clean
401
469
  const reviewTrace = snapshot.review_trace || null
402
470
  const maintenance = snapshot.db_maintenance || null
471
+ const dbLock = snapshot.db_lock || null
403
472
  const traceStatus = reviewTrace?.status || "missing"
404
- const workflowState = snapshot.workflow_state
405
- const nextAction = snapshot.recommended_next_action
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 || {}
473
+ const summaryLines = workflowSummaryLines(snapshot)
410
474
 
411
- if (typeof isFresh === "undefined" && !headCommit && !nextAction) {
475
+ if (typeof isFresh === "undefined" && !headCommit && summaryLines.length === 0) {
412
476
  return null
413
477
  }
414
478
 
@@ -431,73 +495,33 @@ export function formatDogfoodStatusSummary(snapshot: DogfoodStatusSnapshot): str
431
495
  lines.push(
432
496
  `- DB maintenance: ${maintenance.due ? "due" : "ok"} (${maintenance.reason || "unknown"}${typeof maintenance.db_size_mb === "number" ? `, ${maintenance.db_size_mb} MB` : ""})`,
433
497
  )
498
+ if (maintenance.recommended_action) {
499
+ lines.push(`- DB maintenance action: ${maintenance.recommended_action}`)
500
+ }
434
501
  }
435
- lines.push(`- Review trace: ${traceStatus}`)
436
- if (workflowState) {
437
- lines.push(`- Workflow state: ${workflowState}`)
438
- }
439
- if (nextAction) {
440
- lines.push(`- Next action: ${nextAction}`)
441
- }
442
- if (nextCommand) {
443
- lines.push(`- Suggested command: ${nextCommand}`)
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}`)
502
+ if (dbLock?.locked) {
503
+ const holders = Array.isArray(dbLock.holders) ? dbLock.holders.filter(Boolean) : []
504
+ const recovery = Array.isArray(dbLock.recovery) ? dbLock.recovery.filter(Boolean) : []
505
+ if (holders.length) {
506
+ lines.push(`- DB lock holders: ${holders.join("; ")}`)
507
+ }
508
+ if (recovery.length) {
509
+ lines.push(`- DB lock recovery: ${recovery.join("; ")}`)
510
+ }
459
511
  }
512
+ lines.push(`- Review trace: ${traceStatus}`)
513
+ lines.push(...summaryLines)
460
514
  return lines.join("\n")
461
515
  }
462
516
 
463
517
  export function formatWorkflowGuidanceBlock(snapshot: DogfoodStatusSnapshot): string | null {
464
- const workflowState = snapshot.workflow_state
465
- const nextAction = snapshot.recommended_next_action
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 || {}
518
+ const lines = workflowSummaryLines(snapshot)
470
519
 
471
- if (!workflowState && !nextAction && !nextCommand && !blockers.length && !warnings.length) {
520
+ if (!lines.length) {
472
521
  return null
473
522
  }
474
523
 
475
- const lines = ["## CodeGraph Workflow Guidance", ""]
476
- if (workflowState) {
477
- lines.push(`- Workflow state: ${workflowState}`)
478
- }
479
- if (nextAction) {
480
- lines.push(`- Next action: ${nextAction}`)
481
- }
482
- if (nextCommand) {
483
- lines.push(`- Suggested command: ${nextCommand}`)
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
- }
500
- return lines.join("\n")
524
+ return ["## CodeGraph Workflow Guidance", "", ...lines].join("\n")
501
525
  }
502
526
 
503
527
  export function formatWorkflowStateTransition(
@@ -544,33 +568,7 @@ export function formatAfterTestGuidance(
544
568
  lines.push("- Suggested command: rerun the failing tests after you fix them")
545
569
  return lines.join("\n")
546
570
  }
547
- if (workflowState) {
548
- lines.push(`- Workflow state: ${workflowState}`)
549
- }
550
- if (nextAction) {
551
- lines.push(`- Next action: ${nextAction}`)
552
- }
553
- if (nextCommand) {
554
- lines.push(`- Suggested command: ${nextCommand}`)
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
- }
571
+ lines.push(...workflowSummaryLines(snapshot))
574
572
  return lines.join("\n")
575
573
  }
576
574