Repository navigation
feat(lockfile): warn and keep packages when an optional field is unknown - #399
Merged
Merged
Conversation
An unknown optional key on a lockfile that already resolves packages now prints one stable warning per file per key and leaves the dependency set in place. Truncated or invalid lockfiles still fail closed. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Crowers <crowers@users.noreply.github.com>
…wn-optional-69c7 Co-authored-by: Crowers <crowers@users.noreply.github.com>
Unknown optional lockfile fields keep the dependency set. vg prints one warning per path and field: unknown optional lockfile field "<name>"; continuing with the fields this version understands. A field name that is not a plain identifier is reported as (name omitted). Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Crowers <crowers@users.noreply.github.com>
vibgrate-team
marked this pull request as ready for review
October 8, 2026 21:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lockfile readers already kept the fields they understand and failed closed on truncated or invalid documents. An unknown optional key stayed in the dependency set with no warning.
vgnow keeps that dependency set and prints one stable warning per file per unknown field name, for example:When the field name can't be shown safely, the line says
(name omitted)instead. Field values, environment variables, and authorization headers are never printed. Formats with no optional field names (a Gradle lock line, a Gemfile spec, ago.sumline) still fail on an invalid line.A shared helper in
src/core-open/utils/lockfile-unknown.tscovers npm, pnpm, yarn, poetry, uv, pdm, Pipfile, Cargo, Composer, NuGet, Swift package pins, and pub, and is wired intosrc/engine/lockfile.tsand the dependency-graph scanner. New tests insrc/engine/lockfile-unknown.test.tslock in that rows are kept and the warning is emitted once.Related issues
Closes #270
Checklist
pnpm testpassespnpm lintis cleanpnpm typecheckis cleanHow to verify
pnpm test pnpm lint pnpm typecheck