Skip to content

feat(artifacts): inspect Maven POM and Gradle module metadata - #10353

Merged
N0zoM1z0 merged 46 commits into
morluto:mainfrom
mvanhorn:feat/maven-gradle-metadata
Nov 17, 2026
Merged

N0zoM1z0 merged 46 commits into
morluto:mainfrom
mvanhorn:feat/maven-gradle-metadata

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Adds inspect-maven-gradle-metadata / inspect_maven_gradle_metadata to read a supplied POM or Gradle module document as local Evidence. It records declared coordinates, dependency/constraint rows, requested version spellings, unresolved properties, variants and available-at references without running build tools or resolving/fetching dependencies. Related to #8828; snapshot comparison, POM/JAR linking, profile activation and Gradle capabilities remain outside this increment, so this PR does not close that issue.

The integration preserves the author's singleton and preallocation/report bounds, uses shared JSON duplicate policy and transport-URL redaction, and replaces the private report failure with tagged LimitRefs. Omitted caller controls remain omitted through actual application-admitted MCP, CLI, late cancellation and retained Evidence. Physical admission stays separate from report/XML limits; failed cleanup retains its owner and completed file identity. The streamed XML counter defers only known syntax/count-stop outcomes and preserves opaque failure before DOM allocation. Lazy property occurrences feed one report-wide 65,536-record Budget, charged before reference deduplication storage and unresolved-record creation. Missing child artifactId remains a direct missing-coordinate fact; only group/version receive parent hints. Main's lazy composition and Grok verifier are retained. Owning contracts, docs, provider lifecycle/capability maps and generated metadata are updated.

Executed local validation with pinned Node 24.22.1, including the final main5ccb integration base:

  • A 492-case integration selection passed across parser, public, schema, capability/completion and physical/lifecycle boundaries. The focused reference/gap correction uses quotas 2/3 and small benign placeholders; component/parser controls and final rebuilt CLI/MCP/retained-record checks passed. Nine existing large allowance cases were excluded from the focused follow-up; no property-exhaustion corpus or baseline OOM test was run. Regressions preserve caller choices, malformed/opaque distinctions and identity through failed cleanup/retry.
  • 18 actual CLI/stdio-MCP comparisons against official Kotlin stdlib 2.0.21 POM/module metadata match an independent Python XML/JSON oracle. Declared coordinates, 16 variants, two dependencies, nine constraints and nine unfetched available-at references agree. Twelve full retained records equal delivered Evidence; omitted/default/nondefault controls stay distinct, cleanup completes and both file digests remain unchanged.
  • Source/script typechecks, changed lint/format, architecture/module/numeric checks, Knip, docs and advertised-schema checks passed.

Limits: these two published metadata files establish declaration compatibility only; they do not prove effective models, resolved graphs, signatures, source correspondence or runtime behavior. Parent/property/BOM semantics have separate fixture coverage. Optional C++/Rust schema validators were unavailable locally. Combined check:fast/check:pr/full typed lint were not run locally. On final head 6ff6c1a8c772f8f637870d8a60e22b60932ca135, GitHub source tests, all 12 built shards, Static checks, Portable tests, CI required and Greptile passed without bypass. The Windows capability lane was skipped. 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.

@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-17T14:27:22.201818Z
We couldn’t complete this review. Comment @codex review to try again.
6ff6c1a 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.

@greptile-apps

greptile-apps Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[High impact] The PR appears safe to merge; both numbered findings are fixed and no new blocking issue was established.

Summary

Adds local Maven POM and Gradle module-metadata inspection through shared CLI and MCP workflows.

  • Maven POMs and Gradle modules now report declared dependency facts.
  • Metadata Evidence stays tied to the selected file and caller controls.
  • CLI and MCP callers can inspect a selected Maven or Gradle metadata file.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Input[Selected local file] --> Read[Stable bounded read]
  Read --> Identity[SHA-256 and byte count]
  Read --> Parser[Bounded POM or Gradle parser]
  Parser --> Report[Declared metadata report]
  Identity --> Report
  Report --> Service[Validate report and create Evidence]
  Service --> CLI[CLI output]
  Service --> MCP[MCP output and retained Evidence]
Loading

Reviews (38) · Last reviewed commit: "chore(maven): preserve current artifact ..." · Reviewed by Greptile

Comment thread src/java/MavenGradleMetadataParser.ts Resolved
Comment thread src/java/MavenGradleMetadataParser.ts Resolved
Comment thread src/java/MavenGradleMetadataParser.ts Resolved
Comment thread src/java/MavenGradleMetadataParser.ts Resolved
Comment thread src/java/MavenGradleMetadataParser.ts Resolved
Comment thread docs/maven-gradle-metadata.md 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: da3ff50992

ℹ️ 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/java/MavenGradleMetadataParser.ts Resolved
Comment thread src/java/MavenGradleMetadataParser.ts Resolved
Comment thread src/java/MavenGradleMetadataParser.ts Resolved
Comment thread src/java/MavenGradleMetadataParser.ts Resolved
An empty <relativePath/> and an omitted tag both read as null, and a
property-spelled <optional> lost its text. Record relative_path_declared on
the parent, keep optional_spelling beside the interpreted optional boolean,
and list an optional ${property} in unresolved with field "optional".

@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: 231decd6fd

ℹ️ 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/java/MavenGradleMetadataParser.ts Resolved
Comment thread src/java/MavenGradleMetadataParser.ts Resolved
mavenPropertyReference returned only the first ${...} match, so a
CI-friendly version such as ${revision}${sha1}${changelist} recorded only
${revision} in unresolved. Replace it with mavenPropertyReferences, which
returns every distinct reference in order, and emit one unresolved entry
per reference for coordinates and optional.
A variant's available-at.url such as https://user:password@host/... was
returned unchanged in Evidence. Remove the userinfo span with
parseRecordedTransportUrl, record url_credentials_redacted, and withhold
the URL when the credential span cannot be located.

@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: 0dc2d4b3fb

ℹ️ 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/java/MavenGradleMetadataParser.ts Resolved
Comment thread src/java/MavenGradleMetadataParser.ts Resolved
Comment thread src/java/MavenGradleMetadataParser.ts Resolved
The authored reverse-engineer-anything skill gained Maven/Gradle guidance,
but the synced .cursor-plugin copy was not regenerated, failing
docs:check, verify:package and the cursorPlugin conformance test.
@mvanhorn

Copy link
Copy Markdown
Contributor Author

The red Documentation, Native package and Source tests jobs all came from the synced .cursor-plugin copy of the reverse-engineer-anything skill lagging the authored one, so 2053192 regenerates it with scripts/generate-cursor-plugin-skill.mjs.

The malformed-metadata failure copied the JSON.parse message, whose V8
preview quotes source text such as "url": //user:secret@host. Return a
source-free diagnostic instead.
The unresolved collector only visited group_id, artifact_id, version and
optional, so ${...} references in project packaging and in dependency
scope, type and classifier were never listed. Collect them through one
property-reference helper and extend the unresolved field enum.
Gradle writes an exclusive lower bound as ], so a request such as
]1.0,2.0] was reported as a literal by the Maven-only check. Replace
mavenRequestedVersionKind with requestedVersionKind, which takes the
document format and also accepts ] as a Gradle range delimiter.

@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: d457332fa1

ℹ️ 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/domain/java/mavenGradleMetadata.ts Resolved
The /\$\{([^}]+)\}/ pattern backtracked over the remaining text for every
unterminated ${ prefix, so repeated prefixes made matching quadratic and
could stall inspection well within the file budget. Replace it with an
indexOf scanner that stops at the first ${ with no later }, keeping the
same matches.

@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: 08c6dc7155

ℹ️ 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/java/MavenGradleMetadataParser.ts Resolved
Comment thread src/domain/java/mavenGradleMetadata.ts Resolved
Assert the malformed kind and that the fixture credentials and source
excerpt stay out of the message instead of freezing the full sentence.
@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.

Gradle `1.+` and `latest.release` request a dynamically selected
version, so report version_kind `dynamic` for them in Gradle module
metadata instead of `literal`, and document the new kind.
@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.

…port

Each Gradle dependency and constraint row repeats its variant name in the
report. Count those characters while parsing and refuse the module with
MavenGradleMetadataReportFailure once they pass the fixed 4 MiB-character
allowance, so a small metadata file cannot expand into a huge report. The
provider maps the refusal to a non-retryable resource_constraint with the
fixed report allowance remediation.
@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.

The repeated variant-name provider test created its directory with
mkdtemp and never removed it. createTestTempDirectory registers awaited
cleanup after the test, so the provider still closes in finally first.
@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

Merged current main in 4d8a755 to clear the conflict. createServer.ts and serviceToolBindings.ts keep both the Maven/Gradle metadata service and main's new dwarfUnits service, and docs/index.md takes main's table with the Maven POM and Gradle module metadata entry added back.

parsePom built the full xmldom tree before any allowance ran, so a POM
under the 16 MiB file ceiling made of millions of tiny elements could
allocate gigabytes before admitDependencyRows refused it.

Count the POM's nodes as a saxes stream first (countXmlNodes stops at
limit + 1) and refuse past 1,048,576 nodes with the xml_nodes report
allowance, which the provider maps to the same memory resource refusal as
the row allowance.
@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.

Comment thread src/java/MavenGradleMetadataParser.ts Resolved
The architecture guard reads a class named for a limit that extends Error as
a local limit failure. The node counter only throws it to stop the stream and
returns the count, so call it StopXmlNodeCount.
@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.

The report allowance counted only dependency and constraint rows, so a
small module file with millions of empty variants, or a row with millions
of empty excludes, expanded into full report records unchecked.

Count variants (4,096) and exclusions summed over every row (65,536) before
building any record, in both Gradle and POM parsing, and refuse past them
with the same MavenGradleMetadataReportFailure the provider maps to a fixed
report allowance. Remediation subjects move into one table keyed by
allowance.
@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 and others added 2 commits November 17, 2026 13:19
Preserve author singleton and XML allocation fixes while integrating current
resource, parser-limit, caller-selection and transport URL owners.

Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning)
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
Resolve conflicts with the NuGet nupkg workflow:
- src/server/serviceToolBindings.ts: keep both service type imports
- scripts/lib/test-projects.mjs: keep both java and nuget test globs
- docs/index.md: take main's table, re-add the Maven POM and Gradle module metadata link
- docs/getting-started/cli.md: keep both CLI sections
@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 picked up the NuGet nupkg workflow, which conflicted with this branch, so cc2ac20 merges it in.

Conflicted files and how they were resolved:

  • src/server/serviceToolBindings.ts: kept both the MavenGradleMetadataService and NugetNupkgService imports.
  • scripts/lib/test-projects.mjs: the src glob now lists both java and nuget.
  • docs/index.md: took main's table and re-added the Maven POM and Gradle module metadata link next to Python packages.
  • docs/getting-started/cli.md: kept both the Maven/Gradle and the NuGet CLI sections.

Comment thread src/java/MavenGradleMetadataParser.ts Resolved
gensokyo-dev and others added 3 commits November 17, 2026 13:37
Merge the latest author limits while keeping one owner for JSON duplicates,
transport redaction, selected caller controls and typed resource failures.
Preserve known XML syntax deferral and reject opaque counting failures before DOM allocation.

Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning)
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
Retain the author's merge of the NuGet main while preserving integrated
metadata admission, resource-limit and Evidence ownership corrections.

Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning)
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
Preserve main's lazy provider and workflow composition and verify the
Maven/Gradle metadata workflow, retained Evidence and bounded cleanup on it.

Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning)
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
@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 refreshed Maven/Gradle integration and producer/consumer corrections. Current-main source/public/lifecycle checks and independent official POM/module CLI/stdio/retained comparisons support the offline declarations scope. Author limits/credential fixes and current lazy composition are preserved. Required exact-head CI and automated review must pass; broader #8828 and documented validation gaps remain explicit.

Comment thread src/java/MavenGradleMetadataParser.ts Resolved
gensokyo-dev and others added 2 commits November 17, 2026 14:18
Scan property occurrences lazily and admit distinct references and coordinate
gaps through one bounded report collector before retaining them.
Keep missing child artifactId separate from inheritable group/version fields.

Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning)
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
Merge current main and qualify Maven CLI/MCP contracts and retained Evidence
without changing the metadata producer fixes.

Assisted-by: Suika (gensokyo-skills:suika-scatter-gather-planning)
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
@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 bounded lazy unresolved-reference owner and field-specific parent-gap correction, including small-quota/source/public/retained evidence. Current main format registrations are preserved, and no full-ceiling/exhaustion claim is made. Required final exact-head CI and automated review must complete before merge; #8828 broader work remains out of scope.

@N0zoM1z0
N0zoM1z0 enabled auto-merge (squash) November 17, 2026 14:36
@N0zoM1z0
N0zoM1z0 merged commit 05be423 into morluto:main Nov 17, 2026
54 checks passed
@mvanhorn

Copy link
Copy Markdown
Contributor Author

@N0zoM1z0 thanks for merging all three: the Android boot and vendor_boot image support in #9487, the NuGet package inspection in #10351, and the Maven POM and Gradle module metadata reader here.

@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.

4 participants