Skip to content

feat(manifest): name JVM Socket facts files after their build - #1587

Merged
Jeppe Fredsgaard Blaabjerg (jfblaa) merged 17 commits into
v1.xfrom
jfblaa/named-socket-facts-files
Oct 9, 2026
Merged

Jeppe Fredsgaard Blaabjerg (jfblaa) merged 17 commits into
v1.xfrom
jfblaa/named-socket-facts-files

Conversation

@jfblaa

@jfblaa Jeppe Fredsgaard Blaabjerg (jfblaa) commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

LLM Description written by Claude Code:claude-opus-5-5

Follows #1589, #1590 and #1591, now in v1.x. Each Maven, Gradle and sbt build now writes its own Socket facts file instead of a shared .socket.facts.json, so builds sharing a directory (Gradle next to Maven, pom.xml next to other-pom.xml) no longer overwrite each other. depscan already accepts any *.socket.facts.json.

  • File-addressed builds are named after the file the tool ran on: pom.xml.socket.facts.json, or other-pom.xml.socket.facts.json for mvn -f other-pom.xml. The Maven extension reports that entry POM. Future .NET support fits the same rule (Foo.sln.socket.facts.json).
  • Directory-addressed builds are named after the tool: gradle.socket.facts.json, sbt.socket.facts.json.
  • Direct dependencies reference the named file in manifestFiles.
  • A leftover .socket.facts.json next to a newly written file triggers a warning.
  • Since producers no longer write the bare name, reachability leaves an earlier .socket.facts.json report out of its input again, as it did before the facts producers existed. The post-scan deletion stays, since a scan without --reach would otherwise upload a stale report.

Dependencies

  • Coana 15.12.4 (on v1.x) contains coana-tech/coana-package-manager#2545 (recognises named facts files, REA-894) and coana-tech/coana-package-manager#2547 (keys facts units by facts file, not directory).
  • Named files upload uncompressed until depscan decompresses them (REA-895).

Testing

  • Unit tests cover naming, placement and the facts-file references.
  • Real runs of the full change: Maven (-f in the same directory and a subdirectory, two modules in one directory), Gradle (-p, :a:util/:b:util sharing a GAV), sbt, and recursive discovery with the sidecar.

🤖 Generated with Claude Code

Every Maven, Gradle and sbt build now writes its own
`<entry>.socket.facts.json` in its build root, so builds sharing a
directory no longer overwrite each other's facts:

- A file-addressed build is named after the file the tool ran on
  (`pom.xml.socket.facts.json`, `other-pom.xml.socket.facts.json` for
  `mvn -f other-pom.xml`); a directory-addressed one after the tool
  (`gradle.socket.facts.json`, `sbt.socket.facts.json`).
- Each build script reports its root and Maven its entry POM, so the
  file lands where its relative paths resolve, also under
  `mvn -f sub/x.xml` and `gradle -p dir`.
- Facts projects carry the build tool's own unique identifier
  (`projects[].id`: Maven GAV, Gradle project path, sbt project id) and
  their own build files (`projects[].manifestFiles`). The sidecar keys
  project classpaths by that id, and the Maven extension keys modules by
  GAV, so two modules sharing a directory stay separate.
- Scan, reach and fix recognise any `*.socket.facts.json`. Reachability
  no longer uploads an earlier bare `.socket.facts.json` report as input.
A dependency on one of the build's own projects now resolves to a
component whose id is that project's id, linked by each build tool's own
resolution: Gradle's project component identifier, Maven's reactor GAV,
and sbt's dependsOn closure. Projects sharing a coordinate (Gradle
`:a:util` and `:b:util` both `ex:util:1`) no longer merge into one
component, and a project's variants (test fixtures, test-jar) collapse
into it.

Resolved artifact paths are keyed by component/project id instead of by
coordinate, so the sidecar gives each sibling component its own
project's sources and targets. An sbt module ID reachable through more
than one dependsOn project is reported as a resolution failure.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issues.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 649eb2f. Configure here.

Comment thread src/commands/manifest/generate-recursive-manifests.mts
Comment thread src/commands/manifest/scripts/sidecar.mts
A reactor rooted away from its discovery directory by -f/-p could mark a
module that escapes it as covered, skipping that module's own build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@mtorp Martin Torp (mtorp) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good ✅

…eports out of input

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mvn -f sub/x.xml and gradle -p dir wrote the facts file to cwd, where its
build-root-relative paths do not resolve.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…onent

projects[].id is the build tool's unique project identifier (Maven GAV,
Gradle project path, sbt project id) and projects[].manifestFiles lists the
project's build files. A dependency on one of the build's own projects is
that project's component, sharing its id, so projects sharing a coordinate
or a directory stay apart. The compute-artifacts sidecar keys paths and
classpaths by id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s-files

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Producers still write that name, so leaving it out of the reachability
upload dropped their dependency graphs. Excluding earlier reports moves to
the change that renames producer output.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s-files

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s-files

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Base automatically changed from jfblaa/facts-project-ids to v1.x October 8, 2026 12:42
…acts-files

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…acts-files

# Conflicts:
#	CHANGELOG.md
#	src/commands/manifest/scripts/assemble.test.mts
@jfblaa
Jeppe Fredsgaard Blaabjerg (jfblaa) merged commit 5f773c9 into v1.x Oct 9, 2026
16 checks passed
@jfblaa
Jeppe Fredsgaard Blaabjerg (jfblaa) deleted the jfblaa/named-socket-facts-files branch October 9, 2026 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants