Skip to content

java: a source package named build is parsed; only a Gradle build's output is skipped (#1545) - #1625

Merged
swapnilpaliwal-sd merged 1 commit into
0.1.4from
fix/1545-build-package-is-source
Sep 28, 2026
Merged

swapnilpaliwal-sd merged 1 commit into
0.1.4from
fix/1545-build-package-is-source

Conversation

@swapnilpaliwal-sd

Copy link
Copy Markdown
Contributor

Refs #1545

What was wrong

The Java source walk (parser/src/workflows/java/java-project-analyzer.ts) skipped every directory named build by name, through the shared EXCLUDED_DIRS. build is also an ordinary Java package name (builders, build steps), so src/main/java/app/build/StepBuilder.java was never parsed, calls into it were unresolved, and no skipped-file row said so. Case 62 (from #1616) carried the gap in its locally blessed .edges golden; only CI's bytecode oracle saw it:

62-build-output-is-not-source  FAIL (bytecode oracle: NEW missing edge)
  oracle=4 engine=2 agree=2 missing=2 (known 0, NEW 2)
  MISSING  app.WidgetValidator#check -> app.build.StepBuilder#<init>
  MISSING  app.WidgetValidator#check -> app.build.StepBuilder#next(String)
63-javadoc-root-is-not-a-project  FAIL (no oracle golden)

This fails engine (java) on every PR against 0.1.4.

The change

  • utils/generated-output.ts: isGradleBuildOutput(parent, name). A build directory is a build's output only when a build.gradle, build.gradle.kts, settings.gradle or settings.gradle.kts sits beside it (the root of a Gradle project or module). Anchored on its owner, the way target is anchored on a pom.xml.
  • The Java walk skips build only when that holds. A build inside a source tree or package path is walked. EXCLUDED_DIRS itself is unchanged, so the XML, YAML, properties and Gradle walks behave as before.
  • ax_fresh.py: build leaves the Java prune set, and gradle_output prunes a Gradle build/ for Java, so the file table, freshness and the language count match the parser. tests/freshness.py checks both halves.
  • Python: no change needed. The Python walk skips only a root-level build/ and only the setuptools output shapes inside it (python-project-analyzer.ts collectRootBuildFiles); a nested build package is already read.

Tests

  • Case 62: both StepBuilder edges are now known_edge (.edges, .type-use re-blessed); .oracle added: oracle=4 engine=4 agree=4 missing=0.
  • Case 63: .oracle added (oracle=1 engine=1 agree=1).
  • New case 64, gradle-build-output-is-not-source: a Gradle root project plus a module, each with generated .java under build/generated/... beside its build script (must be skipped) and a source package named build (must be read). Its .oracle: oracle=4 engine=4 agree=4 missing=0. Control, checked both ways: with the build scripts present the IR names neither generated class; with them removed, 3 IR files name them.
  • expected/oracle-agreement.txt: 48 to 49 compared cases (case 64).
  • Local Java suite: passed 67, failed 0. No other case's golden changed. Local JDK is 21, so the .oracle files come from bytecode_oracle.py (javac + javap) here; CI's JDK 24 run is the check.
  • tests/freshness.py: 24 of 24.

No .known-missing entries were added.

Parser version

This changes parser code. parser/package.json on 0.1.4 is 0.1.1, the same as main; #1616 changed parser code without bumping it. Per the protocol the parser version moves once per release (done by the release commit), so this PR does not bump it. It is the second parser change on 0.1.4 that the release needs to count.

Deep scan deferred.

…utput is skipped

The Java source walk pruned every directory named `build` by name
(EXCLUDED_DIRS), so a real package such as src/main/java/app/build was never
parsed and every call into it was unresolved. Case 62 carried the gap in its
blessed .edges golden; only CI's bytecode oracle saw the two missing
StepBuilder edges.

A `build` directory is now skipped by the Java walk only when it is a Gradle
project's or module's output: a `build` beside build.gradle(.kts) or
settings.gradle(.kts), anchored on its owner the way `target` is anchored on
a pom.xml (utils/generated-output.ts isGradleBuildOutput). The refresher's
file table (ax_fresh.py) applies the same rule, so freshness and the
language count agree with the parser.

Case 62 now resolves both StepBuilder edges (.edges, .type-use re-blessed,
.oracle added); case 63 gets its missing .oracle golden; new case 64 is a
Gradle project with a root and a module build/generated source (skipped) and
a `build` package in each (read).
@swapnilpaliwal-sd
swapnilpaliwal-sd merged commit c6627cc into 0.1.4 Sep 28, 2026
11 checks passed
@swapnilpaliwal-sd
swapnilpaliwal-sd deleted the fix/1545-build-package-is-source branch September 28, 2026 08:53
swapnilpaliwal-sd added a commit that referenced this pull request Sep 28, 2026
swapnilpaliwal-sd added a commit that referenced this pull request Sep 28, 2026
The vendored parser keeps its own version and moves once per release, only
when parser code changed. dev and main ship it at 0.1.1. On 0.1.4, four
merged changes touched parser/: #1592 (a concise arrow body is owned by the
arrow), #1616 (generated-output detection), #1621 (a package's published API
is rooted from package.json) and #1625 (the Java walk and build directories).
So 0.1.2, one bump for the release.

(cherry picked from commit 51c5e8e)

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
swapnilpaliwal-sd added a commit that referenced this pull request Sep 28, 2026
The vendored parser keeps its own version and moves once per release, only
when parser code changed. dev and main ship it at 0.1.1. On 0.1.4, four
merged changes touched parser/: #1592 (a concise arrow body is owned by the
arrow), #1616 (generated-output detection), #1621 (a package's published API
is rooted from package.json) and #1625 (the Java walk and build directories).
So 0.1.2, one bump for the release.

(cherry picked from commit 51c5e8e)

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
qtwang pushed a commit to qtwang/axiomcodegraph that referenced this pull request Oct 11, 2026
The vendored parser keeps its own version and moves once per release, only
when parser code changed. dev and main ship it at 0.1.1. On 0.1.4, four
merged changes touched parser/: AxiomCodeAI#1592 (a concise arrow body is owned by the
arrow), AxiomCodeAI#1616 (generated-output detection), AxiomCodeAI#1621 (a package's published API
is rooted from package.json) and AxiomCodeAI#1625 (the Java walk and build directories).
So 0.1.2, one bump for the release.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant