Conversation
A Java member's qualified name now carries its parameter type list, so overloads are separate nodes instead of collapsing onto one (class, name) key -- in the extractor, the unified call walk, and the Java LSP, which each used to spell the QN themselves. Every name-based lookup that assumed 'Class.method' learns the same rule: the registry's by_name index key, the same-module and import-map probes, qualified-tail matching, the LSP leaf/tail joins, the reference matcher, and the four tests whose assertions encoded the old spelling.
Java Class, Interface, Enum, Method and Constructor nodes now carry the identity TrackerV2 computes: the eight fields name|signature|path|condition|logical_module|type_id|language_type_id|duplicate_fingerprint joined by '|' and MD5-hashed, written as the hashuid property next to hashInput, canonicalSignature, logicalModule, typeId and languageTypeId, with a unique expression index enforcing it.
Contents:
- src/foundation/md5.{c,h}: RFC 1321, byte-compatible with hashlib.md5. Used only to reproduce this digest.
- src/pipeline/pass_hashuid.c: a predump pass that walks the container chain for logical_module, groups declarations by their seven-field key within a file, assigns TrackerV2's duplicate_fingerprint (sha256 of the declaration text plus the group index, ordered by start/end line), and stamps the result. Overloads, fields and the container chain are resolved by QN lookup, so it runs after every file is extracted.
- Extraction records what the identity needs and the graph cannot recover later: hasBody, javaMemberKind for constructors, javaTypeKind for records/annotations/anonymous scopes, and declHash (sha256 of the declaration's source text).
- Anonymous classes become real scopes: their members are extracted as nodes under a \<Type>@<byte offset> scope (the offset keeps several same-type anonymous classes apart, while the scope NAME stays \<Type> so logical_module is unaffected), and the unified call walk plus the Java LSP push the same scope so calls inside the body attribute to the member instead of falling back to the File node.
- docs/JAVA-HASHUID.md documents the field, the coverage, the rules, the queries and the deliberate differences.
Body-less declarations (interface/abstract/native) are stamped too: TrackerV2 stops at declarations that have a body, cbm tracks the declaration itself, so this is a deliberate superset -- identifiable by hasBody:false.
Verified against the TrackerV2 scanner on the same revision (649 Java files, b6016d94): 3,223 identities on both sides, 3,221 hashed inputs byte-identical, the two remaining differences being TrackerV2's own spread-parameter bug (an int[]... parameter is dropped by its extractor).
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
This branch has not been deployed
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.
Java nodes now carry the identity TrackerV2 computes: the eight fields
name|signature|path|condition|logical_module|type_id|language_type_id|duplicate_fingerprintMD5-hashed into ahashuidproperty, with a unique expression index.Two commits:
feat(java): make the parameter type list part of a member identity— overloads become separate nodes instead of collapsing onto one (class, name) key, in the extractor, the unified call walk and the Java LSP; every name-based lookup that assumedClass.methodlearns the same rule.feat(java): stamp a TrackerV2-compatible HashUID on Java nodes— MD5, the predump pass, the extraction-time inputs it needs, anonymous-class members as real scopes, anddocs/JAVA-HASHUID.md.Verified against the TrackerV2 scanner on the same revision (649 Java files, commit b6016d94): 3,223 identities on both sides (class 584 / interface 103 / enum 24 / method 2,350 / constructor 162), 3,221 hashed inputs byte-identical. The two remaining differences are TrackerV2s own spread-parameter bug, where an
int[]...parameter is dropped by its signature extractor.Known deliberate differences, both documented:
hasBody:false).int[]...varargs keep the parameter that TrackerV2 drops.CALLS edge quality does not regress: 9,428 -> 9,733 edges on the reference corpus, high-confidence share 50.0% -> 54.0%. Affected suites (extraction, parallel, java_lsp, repro, store) pass.