Repository navigation
feat(artifacts): inspect NuGet package metadata and dependencies - #10351
Conversation
Read a local .nupkg as a ZIP and report package identity, dependency groups, license, repository metadata, and a contents inventory. The inspect does not restore, execute, or contact a feed. A time that is not a valid ZIP is refused without a partial inventory.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eb3e6f9e7e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
[Medium impact] The PR appears safe to merge based on the reviewed changes. SummaryAdds offline NuGet package inspection through CLI and MCP, with package metadata, dependency groups, ZIP contents, and retained summaries.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
CLI[CLI] --> Service[Validate caller input]
MCP[MCP] --> Service
Service --> Snapshot[Read stable local file and hash]
Snapshot --> ZIP[List bounded ZIP entries]
ZIP --> XML[Select and read bounded metadata]
XML --> Evidence[Create Evidence]
Evidence --> Retention[Retain complete record]
Retention --> Summary[Read summary without reopening package]
Reviews (32) · Last reviewed commit: "fix(nuget): retain ZIP filename encoding..." · Reviewed by Greptile |
Count entries from getEntriesGenerator and stop as soon as the count exceeds max_entries, instead of building every entry with getEntries() first. Adds a regression test that the parser stops after max_entries + 1.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2fb05d4eb8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The feature had a product guide but no specification under docs/specs. Add spec.md, plan.md and tasks.md for artifacts/nuget-nupkg and list them in the specs index.
Export NUPKG_LIMITATIONS from the parser as the owner of the member-role, missing, ambiguous and malformed .nuspec limitation text, use it at the producing sites, and have the parser tests assert delivery through those constants instead of freezing the sentences independently.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a61a6a1873
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
zip.js rejects enumeration and member reads with the caller's abort reason, and wrapZipFailure turned that plain error into a malformed package. Recognize the originating signal's reason and raise a cancelled ArtifactReaderFailure carrying it, so the provider reports cancellation instead of invalid_format, while independent ZIP failures stay format failures. Adds a parser regression that aborts between enumeration and the .nuspec read.
contents[].name carried the normalized lookup path, so ./lib/x.dll and lib/x.dll were reported under the same spelling and the stored name was lost. Keep the ZIP member name as stored in name and add path for the normalized logical path that drives role and .nuspec lookup, matching how ZipArtifactReader keeps sourcePath separate from path. Documents the new field and adds a parser regression for a ./-prefixed member.
The CLI advertised --detail summary, but no analysis view owner handled inspect_nuget_nupkg, so a successful inspection reached unsupportedParent and failed before the requested bundle was written. Register a summary-only projector that reports package identity, license, repository, the selected .nuspec, coverage, and counts of dependency groups, dependencies, contents and limitations, add its result schema to the summary view union, and document CLI summary delivery.
_rels/.rels was expanded into an unbounded Uint8ArrayWriter and decoded without a limit, so a small, highly compressed member could exhaust memory despite max_file_bytes and max_nuspec_bytes. Read both metadata members through one helper that refuses a declared size over max_nuspec_bytes before reading and stops a bounded writer as soon as expansion passes the budget, raising the typed max_nuspec_bytes capacity failure. The budget description now names the relationships member. Adds regressions for an oversized member and for one whose declared size understates its expansion.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 65666e417a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A manifest relationship with TargetMode="External" and a relative Target that also named a ZIP member was resolved as internal, because only absolute URIs were excluded. findNuspec then preferred that member over a unique root .nuspec and reported its identity as observed. Check TargetMode before resolving ZIP members and record an explicit limitation for each external target. Adds a parser regression.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 13e2ec4e07
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
CI failed on two generated-docs checks from this branch. The Cursor plugin copy of the reverse-engineer-anything skill was stale after the NuGet reference edits, so regenerate it with scripts/generate-cursor-plugin-skill.mjs. README.md gained a NuGet packages row linking docs/nuget-nupkg.md, and the documentation fact check requires every translated README to carry the same links, so add the translated row before the WASM row in all 23 docs/readme files.
The manifest relationship Target was only stripped of a leading slash, so manifests/./Actual.nuspec kept its ./ segment, missed the ZIP member, and the root .nuspec was published instead, while any .. segment was refused even when it stayed inside the package. Resolve the Target against the package root, dropping . segments and popping on .., and refuse only a target that climbs above the root. Adds parser regressions for both dot forms and for an escaping target.
Both the .nuspec and _rels/.rels were decoded with an unconditional UTF-8 decoder, so a valid BOM-marked UTF-16 manifest threw before the XML parser saw it and the package reported no identity or dependencies, while a UTF-16 relationships member was ignored. Decode both through decodeXmlPlistText, which honors the byte-order mark and verifies any encoding declaration, and widen the decode limitation wording to match. Adds UTF-16LE and UTF-16BE .nuspec regressions.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 66a2360ff3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A metadata member compressed with Zstandard (method 93) whose frame needs a window above the decoder's fixed allowance raised ZSTD_error_frameParameter_windowTooLarge, which wrapZipFailure reported as a malformed package, so the service returned invalid_format for an intact ZIP without the memory-limit recovery. Export the shared typedZipFailure classification from ZipArtifactReader and rethrow its limit failures from the NuGet member read, passing the entry's compression method. Adds a parser regression.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 07f76d21c2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The NuGet provider sent the ZIP reader's fixed 128 MiB Zstandard window refusal down the generic memory-limit path, so CLI and MCP advised retrying with more memory. Map it to a non-retryable fixed allowance and check the public MCP error reply.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…e count Main dropped its redundant second argument; both arguments were the same count here.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
…ped result wrapZipFailure called typedZipFailure but then re-read the raw error message against its own copies of the zip.js format and unsupported error lists. Project the ArtifactReaderFailure reason (limit, unavailable, format) instead and delete the duplicate lists, so ZipArtifactReader stays the single owner of ZIP error classification. Reported messages are unchanged; a format failure now also carries the typed failure as its cause.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
…mber findNuspec built every target's full filename bucket with flatMap before the Set dedup and the ambiguity check. A package declaring thousands of case-variant relationship Targets that all hit one large case-folded bucket allocated tens of millions of temporary entries. distinctTargetMatches now collects members incrementally and returns as soon as a second distinct member proves the manifest ambiguous, so the work is bounded by the target count plus two.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Bind the tool through main's shared service binding table, declare its availability on the contract, and report coverage with the shared coverage vocabulary that main's new guards require.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Resolve the conflict in src/cliCommandNames.ts by taking main, where contracts that declare cli: true own their CLI command name. Declare cli: true on inspect_nuget_nupkg and drop its CLI_COMMANDS entry from the nuget CLI registration.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Main moved after your merge and this conflicted again, so fb167fa merges the latest main into the branch. The one conflict was src/cliCommandNames.ts. I took main's version, where a contract with cli: true owns its command name, then set cli: true on inspect_nuget_nupkg and dropped the CLI_COMMANDS reference from src/cli/nugetNupkgCommands.ts. Locally on Node 24.22.1, |
Merge current main while preserving package metadata Evidence, caller selections, transport credential redaction and current artifact resource ownership. Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning) Co-authored-by: gensokyo-dev <[email protected]>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
gensokyo-dev
left a comment
There was a problem hiding this comment.
Reviewed the NuGet integration, shared producer/consumer corrections and executed evidence. Independent official-package CLI/stdio/retained comparisons and source/public/cleanup regressions support the scoped offline metadata capability; runtime/signature and local resource-guard gaps remain explicit. Required exact-head CI and automated review must pass before merge.
Reuse the ZIP owner's raw-byte and legacy-encoding limitation with member context in NuGet Evidence, preserving it through CLI, MCP and retained output. Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning) Co-authored-by: gensokyo-dev <[email protected]>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
gensokyo-dev
left a comment
There was a problem hiding this comment.
Reviewed the focused shared ZIP filename-provenance correction and its parser/public/retained evidence. It preserves existing name interpretation while retaining raw bytes and uncertainty through NuGet. Required exact-head CI and automated review must complete before merge; prior documented verification/resource gaps remain explicit.
Adds
inspect-nuget-nupkg/inspect_nuget_nupkgfor a supplied local package, with retained metadata views. The result contains exact input identity, nuspec identity/license/repository declarations, dependency groups and asset paths. Missing/ambiguous metadata, malformed bytes and unsupported layouts remain explicit. No restore, feed access, installation or package execution. Fixes #8144.Current resource/port owners and bounded ZIP decoding handle admission, failure and cleanup. Shared tagged limits/Budget replace the private capacity carrier; caller omissions remain omitted in Evidence while execution receives defaults. Transport userinfo is removed while other URL spelling/query values remain intact. OPC lookup identity is separate from redacted display, and opaque ZIP failures retain their cause. Shared filename facts preserve raw legacy bytes with member context and an explicit CP437 fallback warning. Hash-only failures retain completed file identity rather than becoming full package Evidence. Contracts, provider capability/lifecycle maps, documentation and schema summaries are updated.
Validation:
eb8092eeca3e44c18eab03e610e0cc854adb67e4, GitHub source tests, all 12 built shards, Static checks, Portable tests, CI required and Greptile passed; no gate was bypassed. The Windows capability lane was skipped.Coverage limits: one official package establishes metadata compatibility only. Publisher signature, source/build correspondence and restore/runtime behavior are unverified; optional C++/Rust schema engines were unavailable locally. Combined
check:fasthit the 6 GiB early guard and was not retried; final payload counters were unavailable, and the exact scope was subsequently confirmed inactive. Relevant serial checks passed; full typed lint/the complete suite were not run locally. No dependencies or unrelated software were installed.Author readiness
Human owner: @mvanhorn