Skip to content

bug: saved FixMap reports rank as high-confidence changed files in later --working-tree maps, contradicting the output-file exclusion guarantee #640

Description

@aryamthecodebreaker

Summary

The docs promise:

The current issue, comparison, verification, and output files are kept out of ranking, change detection, and cache state, so a saved FixMap report cannot recommend itself.

That exclusion appears to apply only to files written by the current invocation. A report saved by a previous invocation ranks as a high-confidence "changed file" in later plan --working-tree runs, appears under Changed Files, and outranks task-relevant ranking candidates. fixmap setup artifacts behave the same way.

Environment

  • fixmap 0.9.0 (npm global)
  • Windows (win32), Node v24.13.0

Repro

git init demo && cd demo
Set-Content package.json '{"name":"demo","scripts":{"test":"node --test"}}'
New-Item src, test | Out-Null
Set-Content src/pay.js 'export function pay(amount){ return amount*2; }'
Set-Content test/pay.test.js 'import "../src/pay.js";'
git add -A; git commit -m init

# 1. Save a report at the repo root (a very common workflow)
fixmap plan --issue "fix pay" --format json --output saved-report.json

# 2. Edit the source (uncommitted)
Set-Content src/pay.js 'export function pay(amount){ return amount*3; }'

# 3. Map the working tree
fixmap plan --working-tree --include-untracked

Actual (step 3)

## Context Files

- `src/pay.js` (high confidence, score 57): changed file; ...
- `saved-report.json` (high confidence, score 22): changed file; content matches task terms: pay

...

## Changed Files

- `saved-report.json`
- `src/pay.js`

A stale FixMap artifact is presented to the agent as a high-confidence inspection target and as a changed file of this edit. In sessions with several accumulated reports (out-1.json, out-2.json, …) they crowd the default --limit 8: in one observed run, six old reports plus a scratch JSON filled seven of eight context slots while the only relevant source file ranked behind them.

Related downstream effect seen in that crowded run: the Impact Graph routed the repo's test onto an artifact instead of the source file it imports (test/auth.test.js … routed test for big-plan.json). That attribution bug has a separate, cleaner repro (issue to follow), but artifact crowding is what exposed it.

fixmap setup outputs (.claude/skills/fixmap/SKILL.md, .cursor/commands/fixmap.md, …) rank identically as high-confidence changed files after any working-tree edit, since most users don't commit them immediately.

Expected

FixMap-generated artifacts should not compete with real source in later maps — per the quoted guarantee, output/report files should be kept out of ranking and change detection regardless of which invocation produced them, or at minimum be heavily deprioritized in --working-tree mode.

Suggested fix

FixMap already ships a structural validator (fixmap validate). When scanning untracked/changed paths, parse each candidate JSON at the repo root: if it validates as a FixMap report (or carries the reportVersion marker), exclude it from ranking/change detection the same way the current invocation's --output target is excluded. Setup artifacts could be recognized by their fixed paths (.claude/skills/fixmap/**, .cursor/commands/fixmap.md, .github/prompts/fixmap.prompt.md, .agents/skills/fixmap/**).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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