feat: git mind status dashboard command (WATCHTOWER)#186
Conversation
Implements WATCHTOWER milestone — graph health dashboard showing node counts by prefix, edge counts by type, and health indicators (blocked items, low-confidence edges, orphan nodes). Supports --json for CI. 8 new tests (95 total).
📝 WalkthroughWalkthroughAdds a new Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant CLI as "bin/git-mind.js"
participant Cmd as "src/cli/commands.js"
participant Graph as "Graph (graph loader)"
participant Status as "src/status.js"
participant Format as "src/cli/format.js"
participant Output as "Terminal / stdout"
User->>CLI: git mind status [--json]
CLI->>Cmd: status(cwd, { json: bool })
Cmd->>Graph: load graph from cwd
Graph-->>Cmd: graph
Cmd->>Status: computeStatus(graph)
Status->>Graph: getNodes(), getEdges()
Graph-->>Status: nodes, edges
Status->>Status: aggregate prefixes/types<br/>compute health metrics
Status-->>Cmd: GraphStatus
alt json flag set
Cmd->>Output: JSON.stringify(GraphStatus)
else
Cmd->>Format: formatStatus(GraphStatus)
Format-->>Cmd: formatted string
Cmd->>Output: write formatted string
end
Output-->>User: display result
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In `@src/status.js`:
- Around line 41-45: The low-confidence check (confidence < 0.5) is duplicated
in src/status.js (lowConfidence calculation using edges.filter) and
src/views.js; extract a shared helper function (e.g., isLowConfidence(edge)) and
replace the inline edges.filter predicate in both places with calls to that
helper so the threshold lives in one location (update any imports/exports as
needed and use the helper name isLowConfidence where the predicate was used).
- Around line 38-39: The comment is misleading because blockedItems currently
counts the number of edges with label 'blocks' rather than the number of
distinct blocked targets; change the implementation so blockedItems represents
unique targets by extracting e.to from edges.filter(e => e.label === 'blocks'),
putting those e.to values into a Set, and using Set.size for blockedItems (keep
the comment describing "distinct targets" and update the code path that computes
blockedItems accordingly; refer to the blockedItems variable and the
edges.filter(e => e.label === 'blocks') expression).
In `@test/status.test.js`:
- Around line 46-56: Add a test case to exercise the fallback path where
extractPrefix returns null by creating at least one node without a colon (e.g.,
a source or target like "README" or "untagged") using the existing createEdge
helper, call computeStatus(graph) and assert that s.nodes.byPrefix['(none)']
equals the expected count; reference computeStatus and extractPrefix in the test
so the '(none)' bucket is verified alongside the existing prefix counts.
- blockedItems now counts distinct blocked targets via Set, not raw edge count - Extract isLowConfidence() helper into validators.js (shared by status + views) - Add test for prefix-less nodes falling into the (none) bucket - Export isLowConfidence and LOW_CONFIDENCE_THRESHOLD from public API
|
@coderabbitai review please |
|
🧠 Learnings used✅ Actions performedReview triggered.
|
Summary
git mind statuscommand — a single-pane graph health dashboard--jsonflag for CI pipeline consumptioncomputeStatus(graph)exported as public API fromsrc/status.jsWhat it looks like
Files changed
src/status.js— new:computeStatus()domain logictest/status.test.js— new: 8 testssrc/cli/commands.js— addedstatuscommandsrc/cli/format.js— addedformatStatus()bin/git-mind.js— wired upstatus+--jsonsrc/index.js— exportscomputeStatusCHANGELOG.md— updatedTest plan
Closes #185
Summary by CodeRabbit
statuscommand to view graph metrics (node/edge counts, grouped summaries, and health indicators such as blocked items, low-confidence edges, and orphan nodes)statussupports JSON output via--jsonfor programmatic use