Skip to content

fix: fail scan on a truncated lockfile - #435

Merged
vibgrate-team merged 6 commits into
mainfrom
cursor/truncated-lockfile-error-e092
Oct 11, 2026
Merged

vibgrate-team merged 6 commits into
mainfrom
cursor/truncated-lockfile-error-e092

Conversation

@vibgrate-team

@vibgrate-team vibgrate-team commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

vg scan and vg build now stop when a lockfile is truncated or not valid syntax, before a partial dependency graph is built and before parse workers start.

The error names every bad lockfile in path order and tells you to regenerate it with your package manager. It does not echo lockfile contents, and the process exits non-zero without writing scan or graph output. A valid lockfile scans and builds as before.

This covers package-lock.json, pnpm-lock.yaml, yarn.lock and the other supported lockfiles (Cargo, Python, Gradle, Ruby, PHP, Dart, Swift, Bun, Deno, Go and more). An empty go.sum or go.work.sum is still valid, and a lockfile ignored by the root .gitignore is not treated as part of the project.

Related issues

Closes #310

Checklist

  • pnpm test passes
  • pnpm lint is clean
  • pnpm typecheck is clean
  • Docs updated where behavior changed
  • Determinism preserved
  • No proprietary or internal references
  • Commits use Conventional Commits and are signed off

How to verify

pnpm test
pnpm lint
pnpm typecheck

cursoragent and others added 6 commits October 10, 2026 12:04
vg build already stopped when a lockfile was truncated. vg scan did not:
a nested package-lock.json, yarn.lock, or pnpm-lock.yaml was treated as
absent, or the code-map step was skipped, and the command exited 0.

Check in-scope lockfiles before drift scoring and before parse workers
start, including vg scan --no-graph. The error names the file and the
format and does not include file contents. When several lockfiles are
invalid, the path that sorts first is the one reported.

Closes #310

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: vibgrate-team <vibgrate-team@users.noreply.github.com>
A truncated or syntactically invalid lockfile fails before a dependency
graph is built and before source parse workers start. The error names each
bad file in path order, omits the file contents, and exits non-zero. An
empty go.sum or go.work.sum remains valid.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: vibgrate-team <vibgrate-team@users.noreply.github.com>
Signed-off-by: Cursor Agent <cursoragent@cursor.com>

# Conflicts:
#	CHANGELOG.md

Co-authored-by: vibgrate-team <vibgrate-team@users.noreply.github.com>
Signed-off-by: Cursor Agent <cursoragent@cursor.com>

# Conflicts:
#	src/cli.ts

Co-authored-by: vibgrate-team <vibgrate-team@users.noreply.github.com>
Signed-off-by: Cursor Agent <cursoragent@cursor.com>

# Conflicts:
#	src/reporting/commands/scan.ts

Co-authored-by: vibgrate-team <vibgrate-team@users.noreply.github.com>
@vibgrate-team
vibgrate-team marked this pull request as ready for review October 11, 2026 13:55
@vibgrate-team
vibgrate-team merged commit d42c2c5 into main Oct 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: actionable error when a lockfile is truncated or mid-parse invalid

2 participants