You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(l1): source-root discovery breaks on relative --input and analyzes build/resources fixture copies #199
Two source-root discovery bugs in L1Extractor.extractAll (src/main/java/com/ibm/cldk/syntactic_analysis/L1Extractor.java:100), both reproduced 2026-08-27 on 2.4.1 by running the analyzer on this repo itself:
Relative --input yields an empty symbol table.codeanalyzer -i . -a 3 --schema v2 discovers 0 source roots (No Java modules were built under . (0 source root(s) discovered)) and emits "symbol_table": {} with exit 0. The same invocation with an absolute path discovers 16 source roots and 350 modules. Root cause is path handling around ParserCollectionStrategy/isExcluded when projectRoot is relative.
Gradle build output analyzed as project code. 197 of those 350 modules are keyed under build/resources/test/test-applications/** — Gradle's processResources copies of src/test/resources fixtures. EXCLUDED_SOURCE_ROOTS excludes src/test/resources but not its build/resources copy, so fixture apps (daytrader8) inflate the symbol table, call graph, and L3 overlays of the analyzed project.
Scope boundary
Discovery scoping only. No change to the v2 schema shape, module content, ids, or the v1 pipeline's own file walking. Not a general "ignore all generated code" policy — only Gradle's build/resources copy dir is excluded; build/generated and Maven target/generated-sources are untouched.
Goals
extractAll with a relative project root discovers the same source roots and produces the same module keys as with the equivalent absolute path
Source roots under build/resources are excluded from discovery
Failing tests first for both, in L1ExtractorTest
Caveats and known risks
A project that deliberately keeps hand-written sources under a directory named build/resources would lose them — accepted; that layout collides with Gradle's own output convention.
Exclusion uses substring match on the root-relative path (existing EXCLUDED_SOURCE_ROOTS mechanism); kept as-is rather than redesigned.
Definition of done
New L1ExtractorTest cases fail before the fix and pass after: (a) relative-root run yields exactly the module keys of the absolute-root run; (b) a fixture .java under build/resources/ yields no module while src/ modules are unaffected
Full ./gradlew test green
Rerunning codeanalyzer -i . -a 1 --schema v2 --no-build on this repo emits a non-empty symbol table with no build/resources keys
Activity