Repository navigation
fix(maven): preserve qualified property keys in metadata - #11860
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The code appears safe to merge; the author's stated human readiness declarations remain pending. SummaryThis PR fixes Maven property names at the parser, so written prefixes survive in CLI, MCP, and retained Evidence.
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 |
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
Evidence and regression coverage
${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 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.