Skip to content

Statusline ADR count is hardcoded to 0/0Β #1047

@easel

Description

@easel

Bug Description

The statusline displays ADRs ●0/0 but this value is hardcoded and never actually counts ADRs.

Location

dist/src/commands/hooks.js line ~3035:

`${c.cyan}ADRs${c.reset} ${c.dim}●0/0${c.reset}  ${c.dim}β”‚${c.reset}  ` +

Expected Behavior

The ADR count should be dynamic. There's already a getADRStatus() function in statusline-generator.js that:

  1. Checks for adr-compliance.json in .claude-flow/metrics/
  2. Falls back to scanning docs/adrs/, docs/adr/, etc. for ADR files
  3. Counts files matching ADR-*.md pattern
  4. Checks for Status: Accepted or Status: Implemented in content

But this function is never called by the hooks.js statusline command.

Suggested Fix

Option A: Wire up getADRStatus() in hooks.js

Option B (Better): Query the memory system instead of scanning files

// ADRs indexed in memory are more reliable than file scanning
const adrCount = await memorySearch({ namespace: 'architecture', pattern: 'adr-*' });

This would:

  • Use the existing memory indexing that users set up
  • Support custom ADR locations (not just hardcoded paths)
  • Be consistent with how other project docs are accessed
  • Handle markdown formatting variations (bold **Status**: vs plain Status:)

Additional Context

  • The docs/adrs path requirement is also too rigid - projects have ADRs in various locations
  • The status detection fails on **Status**: Accepted (markdown bold) - only matches Status: Accepted
  • The JSON output (--json) doesn't include ADR data at all

Environment

  • claude-flow v3.0.0-alpha.185
  • Discovered while setting up doc indexing for a Rust project with ADRs in docs/helix/02-design/adrs/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions