Skip to content

verify: misleading error when a report contextFiles path escapes the repository #635

Description

@aryamthecodebreaker

Found while stress testing the CLI on Windows (v0.9.0, built from main).

Steps to reproduce

  1. Generate a report: fixmap plan --issue "reset token ttl" --repo examples/tiny-auth-app --format json --output out.json
  2. Edit contextFiles[0].path to a traversal path, e.g. ../../evil.ts (everything else untouched)
  3. Run: fixmap verify --report out.json --repo examples/tiny-auth-app --working-tree

Actual

"out.json" has an invalid contextFiles entry at index 0; each entry needs a non-empty string "path", and
version 1 requires rank, score, confidence, and reasons fields with their documented types.

Expected

All field types are valid - the real problem is that the path escapes the repository root. The error should say something like:

"contextFiles[0].path must stay inside the repository (got "../../evil.ts")"

For comparison, changing the path to a benign non-existent file (src/other.ts) is accepted and verify proceeds normally, which confirms the type-check is not what is failing.

Why it matters: hand-edited or third-party-generated reports are a supported workflow (verify exists precisely for that), and this message sends users hunting for a schema problem that does not exist.

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