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
Difficulty: medium.
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.[k]eep,[b]aseline,[s]uppress(prompts for required reason),[o]pen(print issue-creation snippet),[n]ext,[q]uit.--dry-run.Implementation surface
src/cli/commands/triage.ts+src/cli/triage.ts(keyboard loop using Nodereadline; no new heavy TUI dependency unless justified).src/core/baseline.ts,src/cli/suppress.ts/src/core/suppressions.ts, andsrc/reporters/suppressionAudit.ts.Acceptance criteria
--dry-runmakes no writes; refuses to run without a TTY.npm run test:allpasses.Difficulty: medium.