Skip to content

feat(artifacts): inspect NuGet package metadata and dependencies - #10351

Merged
N0zoM1z0 merged 37 commits into
morluto:mainfrom
mvanhorn:feat/nuget-nupkg
Nov 17, 2026
Merged

N0zoM1z0 merged 37 commits into
morluto:mainfrom
mvanhorn:feat/nuget-nupkg

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Adds inspect-nuget-nupkg / inspect_nuget_nupkg for 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:

  • Nine actual CLI/stdio-MCP comparisons against official Newtonsoft.Json 13.0.3, using full/hot-cold tool catalogs, match an independent Python ZIP/XML oracle: 24 members, eight dependency groups/ten rows and 16 library assets. Omitted/default/nondefault budgets remain distinct; six retained summaries agree, cleanup completes and the package digest is unchanged.
  • Public/parser/physical-lifecycle/schema/discovery selections passed 318 cases, including 251 shared physical/lifecycle cases. The filename correction passed 37 parser and 39 public/shared-ZIP cases plus full retained-bundle checks. ASCII, UTF-8 and valid Unicode Path controls retain precise encoding facts. Capability/completion/declaration checks also passed.
  • Source/script typechecks, changed-file lint/format, architecture/module/numeric checks, Knip, documentation and advertised-schema checks passed. On final head 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:fast hit 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

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-17T12:55:35.226765Z
We couldn’t complete this review. Comment @codex review to try again.
eb8092e New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/nuget/NugetNupkgParser.ts Resolved
Comment thread src/nuget/NugetNupkgParser.ts Resolved
Comment thread src/nuget/NugetNupkgParser.ts Resolved
@greptile-apps

greptile-apps Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The PR appears safe to merge based on the reviewed changes.

Summary

Adds offline NuGet package inspection through CLI and MCP, with package metadata, dependency groups, ZIP contents, and retained summaries.

  • NuGet packages now show their metadata and ZIP contents offline.
  • Retained NuGet package evidence now has a compact summary view.

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]
Loading

Reviews (32) · Last reviewed commit: "fix(nuget): retain ZIP filename encoding..." · Reviewed by Greptile

Comment thread src/nuget/NugetNupkgParser.ts Resolved
Comment thread src/nuget/NugetNupkgParser.ts Resolved
Comment thread src/nuget/NugetNupkgParser.ts Resolved
Comment thread src/nuget/NugetNupkgParser.ts Resolved
Comment thread src/domain/nuget/nupkg.ts Resolved
Comment thread src/nuget/NugetNupkgParser.ts Resolved
Comment thread src/nuget/NugetNupkgParser.ts Resolved
Comment thread docs/guides/managed/nuget-nupkg.md Resolved
Comment thread src/nuget/NugetNupkgParser.test.ts Resolved
Comment thread src/cli/nugetNupkgCommands.ts Resolved
Comment thread src/nuget/NugetNupkgParser.ts Resolved
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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/nuget/NugetNupkgParser.ts Resolved
Comment thread src/domain/nuget/nupkg.ts Resolved
Comment thread src/nuget/NugetNupkgParser.ts Resolved
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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/nuget/NugetNupkgParser.ts Resolved
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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/nuget/NugetNupkgParser.ts Resolved
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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/nuget/NugetNupkgParser.ts Resolved
Comment thread src/nuget/NugetNupkgParser.ts Resolved
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.
Comment thread tests/acceptance/nugetNupkgCli.test.ts Resolved
Comment thread docs/guides/managed/nuget-nupkg.md Resolved
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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/nuget/NugetNupkgParser.ts Resolved
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.
Comment thread src/nuget/NugetNupkgParser.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/nuget/NugetNupkgParser.ts Resolved
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.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Comment thread src/nuget/NugetNupkgParser.ts Resolved
…e count

Main dropped its redundant second argument; both arguments were the same
count here.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

…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.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

…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.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

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.
@chatgpt-codex-connector

Copy link
Copy Markdown

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.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@mvanhorn

Copy link
Copy Markdown
Contributor Author

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, npx tsc --noEmit -p tsconfig.json, npm run verify:module-boundaries, oxfmt on the touched files, and vitest on the nuget unit, MCP and CLI acceptance tests plus CapabilityInventory and contractToolBindings all pass.

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]>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@N0zoM1z0 N0zoM1z0 changed the title feat(artifacts): inspect NuGet .nupkg packages and dependency metadata feat(artifacts): inspect NuGet package metadata and dependencies Nov 17, 2026

@gensokyo-dev gensokyo-dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/nuget/NugetNupkgParser.ts Resolved
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]>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@gensokyo-dev gensokyo-dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@N0zoM1z0
N0zoM1z0 enabled auto-merge (squash) November 17, 2026 13:00
@N0zoM1z0
N0zoM1z0 merged commit 43b9fa8 into morluto:main Nov 17, 2026
52 of 54 checks passed
@morluto morluto added area: evidence Evidence, artifacts, and reconstruction enhancement New feature or request labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: evidence Evidence, artifacts, and reconstruction enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Inspect NuGet .nupkg packages and dependency metadata as read-only Evidence

4 participants