Skip to content

bug: empty plan still suggests --explain for a file that was not listed #104

Description

@aryamthecodebreaker

What happened?

When a plan finds zero context files, FixMap still prints the post-report hint:

Expected a file that is not listed? Ask why it was left out:
  fixmap plan --issue "<same task>" --explain <path>

That hint only makes sense when the report listed some files and the user expected a missing one. On an empty match it is confusing — there is nothing "not listed" relative to a ranking, and --explain on a path that was never a candidate just adds noise.

Source: packages/cli/src/cli-runner.ts always returns that footer string after a successful plan (not gated on contextFiles.length > 0).

How can we reproduce it?

mkdir empty-repo && cd empty-repo
git init && echo hello > readme.txt
git add . && git commit --trailer "Co-authored-by: Cursor <cursoragent@cursor.com>" -m init
npx -y @aryam/fixmap@0.7.3 plan --issue "fix the login bug" --format markdown

Observe: diagnostics correctly warn no-context-match, then stderr still suggests --explain.

What did you expect instead?

Omit the --explain footer when contextFiles is empty (or when the only diagnostic is no-context-match). Keep it when the report ranked files.

FixMap version or commit

v0.7.3 / local packages/cli on main

Where did this happen?

CLI

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueApproachable contribution with a clear scope

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions