Skip to content

fix(maven): preserve qualified property keys in metadata - #11860

Merged
morluto merged 1 commit into
morluto:mainfrom
ShuaixinHuang:fix/maven-property-qualified-names
Nov 18, 2026
Merged

morluto merged 1 commit into
morluto:mainfrom
ShuaixinHuang:fix/maven-property-qualified-names

Conversation

@ShuaixinHuang

@ShuaixinHuang ShuaixinHuang commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Preserve qualified Maven property keys in metadata Evidence. A valid POM can declare revision, a:revision and b:revision as three distinct keys while its project and dependency versions refer to ${a:revision} and ${b:revision}. The reader currently returns three rows named revision, losing the identifiers needed to correlate those declarations with the retained references.

Problem and expected behavior

The 566-byte regression POM binds a and b to the same namespace URI. Apache Maven's model reader keeps the literal qualified keys distinct; their XML expanded names are not their Maven lookup identities. Baseline main bb5278c reports complete coverage and the correct raw references but erases both prefixes from properties.name.

The shared POM parser selected Element.localName, which omits a prefix. It now records Element.tagName and maps each already-admitted property element directly. This removes the lossy derived key and the unnecessary empty-local-name filtering while preserving declaration order, values and transport-credential handling. The service, CLI, MCP and retained Evidence consume this corrected producer fact without downstream repairs.

Change and scope

This is an ordinary correctness fix in the existing read-only inspector; a new capability scope decision is not applicable. The public schema, budgets, dependencies, input selection, resource lifecycle and tool catalog are unchanged. Reports for prefixed properties now expose their written keys; unprefixed keys keep their spelling. No property evaluation or effective-model/dependency resolution is introduced.

Merged #10353 introduced the current declaration reader; its source, discussion and inline findings were reviewed. The distinct open #11846 / issue #11843 changes XML end-of-line handling in the same parser/guide; this fix does not change that policy. The open Maven-only proposal #9144 is a separate capability. No issue is linked because this source-audit finding had no existing report; targeted all-state searches found no competing qualified-property-key repair.

Contract and boundary impact

  • Semantic owner: src/java/MavenGradleMetadataParser.ts, before service validation and Evidence creation. Qualified names are source identifiers, not display normalization.
  • Consumers: unchanged Maven/Gradle service and CLI/MCP bindings, including get_evidence_bundle. The guide now states how keys relate to retained property references.
  • Effects: the existing tool reads the caller-selected local file. No new writes, network calls, processes or target execution are added to product behavior. Input bytes, path, digest, values, redaction flags and reference spellings are preserved by the regression.
  • The public regression uses the named Maven/Gradle and session contract families for output validation, retaining the existing bundle assertions without a full-catalog lookup.

Evidence and regression coverage

  • Final public fixture/regression files copied onto untouched main bb5278c production: 1 failed / 7 passed. The failure is expected a:revision and b:revision versus received revision; it is not an infrastructure or timeout failure.
  • Fixed selection: 129 passed across eight files, covering parser/schema, unresolved-reference collection, service, filesystem identity/lifecycle, shared XML, compiled CLI and actual stdio MCP.
  • The new public case includes an ordinary revision key beside the two prefixed keys, uses aliases of the same XML namespace to distinguish qualified from expanded names, preserves both full version references, checks CLI/MCP equality and exact retained Evidence, and verifies the original input bytes and SHA-256.
  • Independent executed reference: OpenJDK 21.0.13 with Apache maven-model 3.9.9 and plexus-utils 3.5.1, parsing the exact regression bytes with MavenXpp3Reader.read(..., true). It accepts the POM and retains revision=0, a:revision=11 and b:revision=22, project version ${a:revision}, and dependency version ${b:revision}. Fixture SHA-256: 178674c34d0da09f751fe883cf77c1b3cf73beeee1aab6f1a9f533f3ef98a2aa.

Representative corrected fields:

{"properties":[{"name":"revision","value":"0"},{"name":"a:revision","value":"11"},{"name":"b:revision","value":"22"}]}

Validation performed

Linux, Node 24.22.1 / npm 11.16.0; published head 194e3c8, based on main bb5278c. The tested source hashes match this commit.

  • npm run test:focused -- src/java/MavenGradleMetadataParser.test.ts src/java/MavenGradleUnresolvedCollector.test.ts src/application/java/MavenGradleMetadataService.test.ts src/domain/java/mavenGradleMetadata.test.ts tests/acceptance/mavenGradleMetadataCli.test.ts tests/boundary/mcp/mavenGradleMetadataMcp.test.ts tests/boundary/filesystem/mavenGradleMetadata.test.ts src/domain/xmlDocument.test.ts — 129 passed.

  • npm run check — all six Turbo tasks (typecheck, ordinary lint, format, Knip, metadata and compile), architecture guards across 2,872 source files, and production reachability completed. Ordinary lint checked 7,739 files with zero errors; advisory warnings and 88 reachability candidates remain. The final monolithic typed-lint process received SIGKILL under the 8 GiB host limit, so this command is not reported as passing.

  • node scripts/ci/static-check-report.mjs typed-lint (explicit batch paths) — the full 7,739-file inventory from oxlint --type-aware --threads 1 --debug=files passed in two disjoint 3,870 / 3,869 batches, zero errors each. Inventory equality, exact-once coverage and unchanged source/configuration snapshots were verified; no files or rules were skipped.

  • npm run docs:check — six tasks and eight README consistency tests passed. npm run verify:test-discovery — all 3,787 test/spec files discovered exactly once. git diff --check — passed.

  • Normal pre-commit formatting/lint and pre-push check:fast hooks passed; all four tested file hashes remained unchanged after the commit hook and the working tree is clean.

Compatibility and limitations

This corrects names in previously lossy output rather than adding a schema field; callers matching a prefixed property must use its complete written key. No migration for ordinary unprefixed properties. XML namespace admission and scalar line-ending behavior retain their existing owners.

The fixtures are authored and accepted by a real Maven model reader; frequency in existing projects is unmeasured. The oracle does not run Maven builds, interpolate properties, resolve dependencies, or establish effective-model behavior. Native Windows/macOS and a production POM corpus were not exercised. No performance improvement is claimed.

The final diff was independently re-read for qualified versus expanded names, declaration order, unknown/reference preservation, unchanged redaction and source identity, and affected consumers.

Latest-main compatibility verification

Executed on Linux, Node 24.22.1 / npm 11.16.0, in a separate uncommitted worktree of main 400bcebf plus this PR's unchanged files. Their SHA-256 values match the published commit. Final fetch observed 8cad335, which changes only two unrelated Wabt test files; relevant production and selected test paths are unchanged. No source commit or history rewrite was needed.

  • The same eight focused paths listed above — 129 passed, including compiled CLI, actual stdio MCP and exact retained Evidence.
  • npm run check:fast — both typecheck/lint tasks and architecture guards across 2,872 source files passed. npm run docs:check — six tasks and eight README consistency tests passed. git diff --check and the staged diff check passed.

The original 1 failed / 7 passed bb5278c production baseline is retained; the producing parser is unchanged upstream through the latest fetch. That baseline was not rerun here. The complete 7,739-file typed-lint result above belongs to the published topic; this follow-up does not claim a new full typed-lint or hosted integration run.

Hosted follow-up status

Codex code review completed on 194e3c8 with no findings or unresolved findings. Greptile reviewed the same head and reported no actionable code issues; there are no inline review threads.

CI run 44182260195 completed successfully on published head 194e3c8, including CI required: 35 jobs, nine successful and 26 configured skips. Static checks, the selected test shard, Build package, Documentation, Portable tests, the Windows native-controls cross-build and the Linux native package baseline all passed. The Linux baseline also passed package verification and real Node Inspector discovery/observation. Full source/deep-static and optional platform/provider lanes were configured skips; this is not full-suite or native Windows/macOS runtime qualification.

The separate author-readiness gate fails while the human declarations below remain pending. Automated reviews and CI do not supply human review or merge permission.

Author readiness

Human owner: @ShuaixinHuang

Prepared with AI assistance. These human declarations remain pending; opening this non-draft PR does not attest that the owner reviewed this new diff.

  • 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 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T21:43:11.678250Z 194e3c8 PR opened
ℹ️ 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 17, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The code appears safe to merge; the author's stated human readiness declarations remain pending.

Summary

This PR fixes Maven property names at the parser, so written prefixes survive in CLI, MCP, and retained Evidence.

  • Maven property names keep their written prefixes in metadata.

No actionable code issues were found. Available local history showed no superseding fix; current remote PR status was not verified. ShuaixinHuang explicitly notes the omitted issue link and pending human readiness declarations.

Reviews (1) · Last reviewed commit: "fix(maven): preserve qualified property ..." · Reviewed by Greptile

@morluto
morluto merged commit 004c43e into morluto:main Nov 18, 2026
45 of 49 checks passed
@morluto morluto added the bug Something isn't working label Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants