Repository navigation
fix: bound jdtls group scope by the repo root and log m2e import errors (#110 part A) - #113
Merged
Merged
Conversation
…rs (#110 part A) F2: _find_maven_group_root now stops at the repository/reactor boundary (nearest .git ancestor, else the topmost consecutive-pom ancestor), or at the client root when that is below the boundary. A client root above the repository (e.g. ~/git) can no longer scope jdtls to the whole reactor. The client root / boundary / group root are logged once at INFO. F3: forward jdtls window/logMessage (Error -> WARNING, Warning -> INFO) and language/status (Error -> INFO) to the proxy log, sanitized (URL userinfo, secret query params, Authorization/Bearer values, CR/LF, control chars, 2 KB cap), token-bucket rate limited per kind with in-window dedupe and a periodic suppressed-count line. Log a one-line summary whenever the Error diagnostics set of a pom.xml changes (m2e "Missing artifact" markers). Nothing published to the client changes. Also: version 0.13.1, README troubleshooting row, and ruff format/ignores for scripts/generate-formula.py so the ruff gate passes. Refs #110 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Query-param and URL-userinfo redaction regexes were superlinear on hostile jdtls text (cubic for "?token" repeated); they run on the reader loop. The userinfo run now anchors on "://", query names are bounded, and the secret keyword is checked in a callback. - logMessage/language/status kinds come from an allowlist; unknown values log as "other", so jdtls text never reaches the log line unsanitized and the rate-limit buckets stay bounded. - Flush the suppressed-message count when jdtls dies, not only on stop(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aviadshiber
marked this pull request as ready for review
September 29, 2026 13:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Issue #110 reports false "X cannot be resolved" and "The hierarchy of the type X is inconsistent" errors on classes that live in another Maven group of the same repository. The investigation found two problems that can be fixed now. The full fix comes in a follow-up (part B).
rootUri. When the client root sits above the repository (for example~/git, which we saw in real session logs), the repository's own aggregator pom became a candidate._find_maven_group_root(products/achilles-testing, ~/git)returnedproducts, the whole 1248-pom reactor. Withproductsas the root, it returned the module itself._handle_notificationdroppedwindow/logMessageandlanguage/status. A jdtls spike (1.61.0, m2e 2.7.800) showed that m2e'sMissing artifact g:a:t:vsignal arrives only as Error diagnostics on the dependent module'spom.xml.server.pyfilters those out because it only handles.javafiles, so nobody ever saw them.Change
_find_maven_group_rootnow stops at the repository/reactor boundary: the nearest ancestor containing.git(a directory, or a file for worktrees and submodules). If there is no.gitancestor, it stops at the topmost ancestor reached through consecutivepom.xmldirectories. If the client root is below the boundary, the client root stays the bound. A module directly under the reactor root is scoped to itself, never to the whole reactor. The new_find_repo_boundaryislru_cached on the resolved path, so a symlinked path and its real path share one cache entry.expand_full_workspacelogs the client root, boundary and group root once at INFO, with paths redacted.add_module_if_newlogs the same at DEBUG.window/logMessagetype 1 is logged at WARNING and type 2 at INFO.language/statusErroris logged at INFO. Everything else goes to DEBUG."jdtls[%s]: %s", so message text is never used as a format string.token/key/secret/password/auth/sigquery params andAuthorization/Bearervalues are redacted. CR/LF are escaped, other C0/C1 control characters (including ESC) are stripped, and messages are cut at 2 KB.suppressed N jdtls log messagesline reports how many were dropped.pom.xmlURI changes, the proxy logs one sanitized INFO line: the pom path relative to the client root, the error count, and the first 3 messages. The hook lives in the proxy. What is published to the client does not change.scripts/generate-formula.pygot a ruff-format fix (one blank line), andpyproject.tomlgot a"scripts/*.py" = ["T20", "PLR2004"]per-file ignore. Both are needed becauseuv run ruff check .andruff format --check .already fail onmainfor this script (3 lint errors and 1 file to reformat). The gate below cannot pass without them.Testing
uv run ruff check .: passeduv run ruff format --check .: passeduv run mypy src: passeduv run pytest -q: 891 passed, 1 skipped (the existing measurement-onlytest_e2e_cross_fileH2 case), 88.46% coverage. jdtls is installed locally, so the e2e tests ran.tests/test_proxy_scope_logging.py:.git(topmost consecutive pom);.gitas a file; symlinked paths; the scope logged once at INFO..javafiles not summarized, poms outside the client root redacted.tests/test_proxy.pynow create a.gitat the monorepo root, which is the repository boundary.Refs #110
🤖 Generated with Claude Code