Skip to content

refactor: follow-ups to generating Socket facts with Coana - #1733

Draft
Jeppe Fredsgaard Blaabjerg (jfblaa) wants to merge 7 commits into
jfblaa/facts-5-wizardsfrom
jfblaa/facts-6-follow-ups
Draft

Jeppe Fredsgaard Blaabjerg (jfblaa) wants to merge 7 commits into
jfblaa/facts-5-wizardsfrom
jfblaa/facts-6-follow-ups

Conversation

@jfblaa

@jfblaa Jeppe Fredsgaard Blaabjerg (jfblaa) commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Heads up, reviewer

[Edit me, human!]


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

Cleanups the stack makes possible but its story doesn't need; kept out of it to keep review focused. Opens once the stack is merged.

Commits
  • Pass facts-only types to Coana with --use-only-socket-facts-artifacts alone: facts generation needs a Coana that takes it, so the Maven-only --maven-use-only-socket-facts older releases took is no longer needed.
  • Rename buildToolScriptOptions to buildListingOptions: the scripts it was named after are gone.
Stack
  1. fix: keep the API token and settings socket-cli passes Coana out of the build tools it runs #1725: Keep the Socket API token out of the tools Coana runs
  2. feat(manifest): generate Socket facts with Coana #1726: Generate Socket facts with Coana
  3. refactor(manifest): delete socket-cli's build-tool scripts and facts assembly #1727: Delete socket-cli's build-tool scripts and facts assembly (internal)
  4. feat(manifest): add socket.json reachability settings for the build tools #1728: socket.json reachability settings for the build tools
  5. feat(manifest): ask for the reachability settings in the setup wizards #1729: Reachability settings in the setup wizards
  6. refactor: follow-ups to generating Socket facts with Coana #1733: Follow-ups (draft) (this PR)

Changelog

No entry: internal.

🤖 Generated with Claude Code

Coana passes its environment on to the build tools and package managers
it runs. It now removes the variables it reads (the API token,
organization, API base URL, proxy, User-Agent, CLI version and
repository name) at startup, so socket-cli sets only those for it.

socket-cli also leaves out the other variables it reads the token from
(SOCKET_SECURITY_API_TOKEN, SOCKET_SECURITY_API_KEY, SOCKET_CLI_API_KEY)
and SOCKET_CLI_CONFIG, which can carry one; Coana reads none of them. It
no longer adds its own normalised settings (constants.processEnv) to
Coana's environment, nor the branch name, which Coana does not read.
socket-cli now asks `coana generate-socket-facts` for each build root
instead of running its own build-tool scripts, and lists a build's
projects and a .NET solution's members through the same command.

- Coana writes a root's facts into its state dir under --work-dir and
  names where they belong. The walk always generates into a work dir, its
  own when no later Coana run reads one, and copies the facts of the roots
  it keeps to their target at the end; a dropped run never touches the
  file there. This replaces the save/restore of predicted facts files.
- The kept roots' sidecar entries go to reachability and socket fix as
  --socket-facts-sidecar.
- --auto-manifest builds through the same settings as the walk. Maven
  builds pom.xml by name, so its facts and state stay apart from a Gradle
  build in the same directory, and a --file in mavenOpts becomes the POM
  it builds instead of a build option.
- A --reach-version or --fix-version older than the pinned Coana fails
  facts generation with a message naming that version.
- The standalone build's README says every Coana use needs
  SOCKET_CLI_COANA_LOCAL_PATH.
Coana generates Socket facts now, so socket-cli's own machinery for it
goes: the Gradle init scripts, the sbt plugins, the Maven extension, the
.NET tool, the records parser, the facts assembler and sidecar, the
exclude-path glob compiler, the resolution report renderer, the compat
suites, and the steps that built and bundled them for npm, the package
matrix, CI and the standalone build.
A build tool's socket.json section takes a `reachability` object, which
reachability scans send to Coana with each build root's request:

- `build`: "compile" builds the project before the analysis, "none" or
  unset analyses it unbuilt;
- `javaHome`, Maven, Gradle and sbt: the JDK the analysis takes the
  program to run on, as written;
- `runtimeVersion`, .NET: the runtime a framework-dependent build's
  analysis starts on, as major.minor or major.minor.patch[-prerelease].

Each field cascades on its own, a build's own `builds` entry last, and
null clears an inherited one. Only a reachability scan reads them, for the
build tools it runs, so an invalid value never stops another command. It
checks them before any build runs and fails naming the socket.json and
setting, including a field the build tool does not take.
`socket manifest setup` and `socket manifest setup
--dynamic-sbom-inference` ask, for each build tool that generates facts:

- whether to build the project before reachability analysis. A no writes
  "none" only to override an inherited "compile", and otherwise leaves the
  setting unset;
- Maven, Gradle and sbt: whether to use a different JDK for the analysis,
  showing the one in effect, inherited or not;
- .NET: whether to start a framework-dependent build's analysis on a given
  runtime, taking major.minor or major.minor.patch[-prerelease].

The wizards read socket.json as written, so they run under an invalid
reachability value: they warn about what a build tool cannot take and
replace it with the answers, and ignore an invalid inherited value for
their defaults.
Facts generation needs a Coana that takes --use-only-socket-facts-artifacts,
so the Maven-only --maven-use-only-socket-facts that older releases took is
no longer needed.
The build-tool scripts it was named after are gone; it builds the options
listing a build's projects takes.

This branch has not been deployed

No deployments
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.

1 participant