Skip to content

feat: git mind status dashboard command (WATCHTOWER)#186

Merged
flyingrobots merged 2 commits intomainfrom
roadmap/watchtower
Feb 11, 2026
Merged

feat: git mind status dashboard command (WATCHTOWER)#186
flyingrobots merged 2 commits intomainfrom
roadmap/watchtower

Conversation

@flyingrobots
Copy link
Owner

@flyingrobots flyingrobots commented Feb 11, 2026

Summary

  • Adds git mind status command — a single-pane graph health dashboard
  • Shows node counts by prefix (with percentages), edge counts by type, and three health indicators: blocked items, low-confidence edges, and orphan nodes
  • --json flag for CI pipeline consumption
  • computeStatus(graph) exported as public API from src/status.js

What it looks like

Graph Status
════════════════════════════════

Nodes: 12
  task             5  (42%)
  spec             3  (25%)
  file             2  (17%)
  module           2  (17%)

Edges: 8
  implements       4
  depends-on       2
  blocks           1
  documents        1

Health
  ⚠ 1 blocked item(s)
  ⚠ 2 low-confidence edge(s)
  ✔ No orphan nodes

Files changed

  • src/status.js — new: computeStatus() domain logic
  • test/status.test.js — new: 8 tests
  • src/cli/commands.js — added status command
  • src/cli/format.js — added formatStatus()
  • bin/git-mind.js — wired up status + --json
  • src/index.js — exports computeStatus
  • CHANGELOG.md — updated

Test plan

  • 95 tests passing (8 new status tests)
  • Empty graph returns all zeros
  • Correct node/edge counting and grouping
  • Blocked items, low-confidence, and orphan detection
  • JSON serialization structure verified

Closes #185

Summary by CodeRabbit

  • New Features
    • Added a status command to view graph metrics (node/edge counts, grouped summaries, and health indicators such as blocked items, low-confidence edges, and orphan nodes)
    • status supports JSON output via --json for programmatic use
    • Exposed a low-confidence helper and threshold for consistent confidence checks
  • Tests
    • Added comprehensive tests for status computation and related scenarios

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).
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 11, 2026

📝 Walkthrough

Walkthrough

Adds a new status CLI command that computes and returns graph composition and health metrics (nodes by prefix, edges by type, blocked items, low‑confidence edges, orphan nodes), with both human-readable formatting and a --json output option; includes implementation, formatting, exports, validators, and tests.

Changes

Cohort / File(s) Summary
CLI Entry Point
bin/git-mind.js
Wires new status command into the CLI dispatcher and forwards --json to the command handler.
Command Implementation
src/cli/commands.js
Adds exported status(cwd, opts) command that loads the graph, calls computeStatus, and outputs either JSON or formatStatus output; includes error handling and exit code on failure.
Formatting
src/cli/format.js
Adds formatStatus(status) to render header, node prefix breakdown with percentages, edge type counts, and health section (blocked, low-confidence, orphan) as a formatted string.
Status Computation
src/status.js
New module exporting computeStatus(graph) which aggregates nodes by prefix, edges by type, and computes health metrics: blocked items, low-confidence edges, and orphan nodes.
Validators & Views
src/validators.js, src/views.js
Exports LOW_CONFIDENCE_THRESHOLD and isLowConfidence(edge); views now uses isLowConfidence instead of inline logic.
Public API
src/index.js
Re-exports computeStatus and new validator exports into the package public API.
Tests
test/status.test.js
Adds comprehensive tests covering empty graphs, node/edge counts, prefix grouping, edge type aggregation, blocked items, low-confidence detection, orphan nodes, and JSON serialization.

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through code to count each node and line,
Prefixes sorted, edges tallied fine.
Blocked and doubtful, or alone in night—
I whisper status, JSON or light.
A little rabbit’s dashboard—cheerful, bright!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: introducing a new 'git mind status' dashboard command for the WATCHTOWER project, which accurately reflects the PR's primary objective.
Linked Issues check ✅ Passed All deliverables from issue #185 are met: node summary with prefix breakdown and percentages, edge summary by type, health indicators (blocked items, low-confidence edges, orphan nodes), --json flag support, and comprehensive test coverage.
Out of Scope Changes check ✅ Passed All changes are within scope of issue #185. The refactoring of isLowConfidence into validators.js and updates to src/views.js are necessary supporting changes, not out-of-scope additions.
Docstring Coverage ✅ Passed Docstring coverage is 85.71% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch roadmap/watchtower

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@flyingrobots
Copy link
Owner Author

@coderabbitai review please

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 11, 2026

@flyingrobots: I'll review the changes in this PR right away.


🧠 Learnings used
Learnt from: flyingrobots
Repo: neuroglyph/git-mind PR: 169
File: docs/templates/code-review-feedback.md:26-33
Timestamp: 2025-09-16T17:10:27.477Z
Learning: The user (flyingrobots) uses Obsidian to view/edit Markdown files and prefers to keep Obsidian-specific syntax like collapsible callout markers (e.g., `[!NOTE]-` for collapsible callouts) even if they're not GitHub-compatible.
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@flyingrobots flyingrobots added this pull request to the merge queue Feb 11, 2026
Merged via the queue into main with commit 0a0e9d2 Feb 11, 2026
6 checks passed
@flyingrobots flyingrobots deleted the roadmap/watchtower branch February 11, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: git mind status dashboard command (WATCHTOWER)

1 participant