Skip to content

fix(nuget): tighten bounded CPM props resolution#827

Merged
mstykow merged 5 commits intomainfrom
verify/dotnet-extensions-parser
Apr 30, 2026
Merged

fix(nuget): tighten bounded CPM props resolution#827
mstykow merged 5 commits intomainfrom
verify/dotnet-extensions-parser

Conversation

@mstykow
Copy link
Copy Markdown
Owner

@mstykow mstykow commented Apr 30, 2026

Summary

  • bound NuGet Directory.Packages.props / Directory.Build.props import following to the actual active scan root and deny out-of-scope .props reads
  • preserve imported ordinary .props central package versions during assembly while keeping partially unresolved composed expressions unresolved
  • record the resulting real-world end state in docs/BENCHMARKS.md with refreshed standalone dotnet/extensions and new microsoft/regorus compare-output snapshots

Issues

Scope and exclusions

  • Included:
    • parser scan-root plumbing in src/parsers/mod.rs, src/scanner/collect.rs, and src/scanner/process/orchestrator.rs
    • NuGet .props import/path handling and composed property resolution in src/parsers/nuget/ and src/assembly/nuget_cpm_resolve.rs
    • focused parser and assembly regression coverage for out-of-root import denial, partial-resolution fail-closed behavior, and imported-version preservation
    • benchmark/docs updates for:
      • microsoft/regorus @ 7f42115 from .provenant/compare-runs/20260430T114610Z-regorus-348
      • dotnet/extensions @ 7171956 refresh from .provenant/compare-runs/20260430T115315Z-extensions-9749
  • Explicit exclusions:
    • no full MSBuild evaluation
    • no conditioned PropertyGroup or ItemGroup evaluation beyond the existing bounded behavior
    • no support for Directory.Build.targets, wildcard imports, or arbitrary non-literal import graphs
    • no scorecard edit, since the NuGet verification row is already marked verified

Intentional differences from Python

  • Provenant continues to prefer bounded static resolution over broad evaluator behavior.
  • It now resolves composed central PackageVersion expressions and bounded repository-local .props imports only when the imported file stays under the active scan root.
  • It intentionally fails closed on partially unresolved composed expressions instead of collapsing them into misleading concrete-looking versions.

Follow-up work

  • Created or intentionally deferred:
    • deferred: broader conditioned MSBuild semantics for project/package versions outside the current bounded slice
    • deferred: any future support for non-CPM import graphs or Directory.Build.targets

Expected-output fixture changes

  • Files changed:
    • no golden fixture files were regenerated; coverage was added in unit tests and compare-output evidence instead
  • Why the new expected output is correct:
    • the parser now denies .props imports that escape the active scan root, so out-of-scope property bags are no longer read or surfaced
    • imported ordinary .props package versions are preserved during assembly even when local raw PackageVersion entries also exist
    • final standalone compare-output runs confirm the user-visible end state:
      • microsoft/regorus resolves Microsoft.Regorus to 0.9.1 in central props and consumer dependencies
      • dotnet/extensions root and nested Directory.Packages.props surfaces now carry imported central package-version dependency metadata instead of empty imported-props placeholders

mstykow added 5 commits April 30, 2026 14:15
Signed-off-by: Maxim Stykow <maxim.stykow@gmail.com>
Signed-off-by: Maxim Stykow <maxim.stykow@gmail.com>
Signed-off-by: Maxim Stykow <maxim.stykow@gmail.com>
Signed-off-by: Maxim Stykow <maxim.stykow@gmail.com>
Signed-off-by: Maxim Stykow <maxim.stykow@gmail.com>
@mstykow mstykow force-pushed the verify/dotnet-extensions-parser branch from 547e9e0 to 4044787 Compare April 30, 2026 12:16
@mstykow mstykow changed the title docs(benchmarks): add dotnet/extensions verification fix(nuget): tighten bounded CPM props resolution Apr 30, 2026
@mstykow mstykow merged commit 317925b into main Apr 30, 2026
15 checks passed
@mstykow mstykow deleted the verify/dotnet-extensions-parser branch April 30, 2026 12:28
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.

1 participant