Skip to content

fix(parsers): expand static dependency indirection coverage#826

Merged
mstykow merged 8 commits intomainfrom
improve/static-parser-indirection
Apr 30, 2026
Merged

fix(parsers): expand static dependency indirection coverage#826
mstykow merged 8 commits intomainfrom
improve/static-parser-indirection

Conversation

@mstykow
Copy link
Copy Markdown
Owner

@mstykow mstykow commented Apr 29, 2026

Summary

  • extend Gradle static dependency recovery beyond buildSrc and version catalogs by resolving same-file literal assignments, ext { ... } properties, and nearby gradle.properties values used through $name, ${name}, and Kotlin val ... by project interpolation
  • teach CocoaPods Podfile parsing to follow bounded local require_relative helpers and recover version arguments from simple Ruby hash lookups such as versions['Flipper']
  • expand NuGet property resolution from whole-string $(Property) replacements to embedded and chained MSBuild property expansion, then apply that to PackageReference versions and project metadata
  • resolve richer Ruby gemspec constant expressions from required local files, including interpolated string constants and simple [...].join('.') version builders
  • add one new golden fixture per ecosystem, plus the upgraded existing Gradle props golden, using real-world-style patterns inspired by public repositories

Scope and exclusions

  • Included:
    • Gradle: src/parsers/gradle.rs plus new/updated goldens under testdata/gradle-golden/
    • CocoaPods: src/parsers/podfile.rs plus a new Podfile golden under testdata/cocoapods-golden/podfile/with-required-version-hash/
    • NuGet: src/parsers/nuget/utils.rs, src/parsers/nuget/project_file.rs, and a new PackageReference golden under testdata/nuget-golden/package-reference-interpolation/
    • Ruby: src/parsers/ruby.rs plus a new gemspec golden under testdata/ruby-golden/interpolated-constants/
    • focused unit and golden coverage for every new behavior
  • Explicit exclusions:
    • no Gradle, Ruby, CocoaPods, or MSBuild execution
    • no broad evaluator/AST rewrite project
    • no attempt to resolve dynamic helper methods, arbitrary control flow, network lookups, or generic import graphs outside the existing bounded parser model

Intentional differences from Python

  • These changes continue Provenant's pattern of preferring bounded static resolution over placeholder output or dynamic execution.
  • Gradle now resolves more static indirection directly from committed local files (build.gradle[.kts] plus nearby gradle.properties) without evaluating Gradle.
  • CocoaPods now recovers version arguments from parseable local Ruby hash helpers instead of requiring fully literal inline strings.
  • NuGet now resolves embedded property compositions like $(VersionPrefix)-$(VersionSuffix) when those values are statically available in the project file.
  • Ruby gemspec parsing now handles more constant-expression shapes from local required files, but still refuses to execute Ruby or chase arbitrary load paths.

Follow-up work

  • Created or intentionally deferred:
    • deferred: broader dynamic Gradle DSL evaluation, arbitrary Ruby/CocoaPods execution semantics, and full MSBuild import/condition evaluation remain intentionally out of scope
    • deferred: Podspec-specific Ruby DSL enhancement work beyond the new Podfile hash-resolution slice
    • validation run during implementation:
      • cargo test test_gradle_properties_and_local_assignments_resolve_interpolation
      • cargo test test_extract_pod_version_from_required_hash
      • cargo test test_csproj_package_reference_resolves_embedded_property_versions
      • cargo test test_extract_gemspec_required_file_interpolated_constants
      • cargo test --features golden-tests test_golden_kotlin_project_properties
      • cargo test --features golden-tests test_golden_groovy6_with_props
      • cargo test --features golden-tests test_golden_podfile_required_version_hash
      • cargo test --features golden-tests test_golden_package_reference_project_with_property_interpolation
      • cargo test --features golden-tests test_golden_interpolated_constants_gemspec
      • cargo test parsers::gradle::tests::
      • cargo test parsers::podfile::tests::
      • cargo test parsers::nuget::nuget_test::tests::
      • cargo test parsers::ruby_test::tests::

Expected-output fixture changes

  • Files changed:
    • testdata/gradle-golden/groovy/groovy6-with-props/build.gradle-expected.json
    • testdata/gradle-golden/kotlin/project-properties/build.gradle.kts-expected.json
    • testdata/cocoapods-golden/podfile/with-required-version-hash/Podfile-expected.json
    • testdata/nuget-golden/package-reference-interpolation/IceRpc.Examples.csproj.expected
    • testdata/ruby-golden/interpolated-constants/interpolated_constants.gemspec.expected
  • Why the new expected output is correct:
    • each updated expected file now reflects a static value that is already present in committed local companion files or literal constant expressions
    • no fixture depends on executing a build tool or interpreter; every new value comes from bounded parsing of adjacent manifests/helpers
    • the Gradle, CocoaPods, NuGet, and Ruby fixtures each prove a user-visible extraction improvement that was not previously represented in the parser-owned golden corpus

mstykow and others added 8 commits April 30, 2026 00:35
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Signed-off-by: Maxim Stykow <maxim.stykow@gmail.com>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Signed-off-by: Maxim Stykow <maxim.stykow@gmail.com>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Signed-off-by: Maxim Stykow <maxim.stykow@gmail.com>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Signed-off-by: Maxim Stykow <maxim.stykow@gmail.com>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Signed-off-by: Maxim Stykow <maxim.stykow@gmail.com>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Signed-off-by: Maxim Stykow <maxim.stykow@gmail.com>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Signed-off-by: Maxim Stykow <maxim.stykow@gmail.com>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Signed-off-by: Maxim Stykow <maxim.stykow@gmail.com>
@mstykow mstykow merged commit 273e821 into main Apr 30, 2026
15 checks passed
@mstykow mstykow deleted the improve/static-parser-indirection branch April 30, 2026 06:39
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