Skip to content

Add interactive triage mode (debtlens triage) #255

Description

@cursor

Summary

Add an interactive triage mode (debtlens triage) that walks findings one at a time and lets the user keep, baseline, inline-suppress (with a required reason), or note each one — wiring together baseline + suppression workflows behind a keyboard UI.

Motivation

Adopting DebtLens on an existing repo means processing a backlog of findings. Today that is done by hand across baseline, suppress, and config edits. A guided TUI makes first-run adoption dramatically faster and ensures suppressions get the required auditable reasons.

Proposed behavior

  • debtlens triage [paths] runs a scan and presents findings sequentially with evidence + suggestion.
  • Per-finding actions: [k]eep, [b]aseline, [s]uppress (prompts for required reason), [o]pen (print issue-creation snippet), [n]ext, [q]uit.
  • Batch helpers: apply the same action to all remaining findings of a rule.
  • Writes are committed at the end (or incrementally) via existing helpers; supports --dry-run.

Implementation surface

  • New src/cli/commands/triage.ts + src/cli/triage.ts (keyboard loop using Node readline; no new heavy TUI dependency unless justified).
  • Reuse src/core/baseline.ts, src/cli/suppress.ts / src/core/suppressions.ts, and src/reporters/suppressionAudit.ts.
  • Non-interactive guard: refuse to start without a TTY (clear message) and document for CI.
  • Tests: scripted input simulation, baseline/suppress side-effects, dry-run.

Acceptance criteria

  • Triage applies keep/baseline/suppress actions correctly with required reasons enforced for suppress.
  • Batch-by-rule action works.
  • --dry-run makes no writes; refuses to run without a TTY.
  • Docs + CHANGELOG updated.
  • npm run test:all passes.

Difficulty: medium.

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