| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
The flag lived in reachabilityFlags, so when the --reach guard switched from a hand-maintained list to a derivation over every boolean in that object, `scan create . --dynamic-sbom-inference` started failing with "Reachability analysis flags require --reach to be enabled". It is not a --reach-* modifier; move it to generalFlags so the guard no longer sees it and the help text stops filing it under Reachability Options. It also implied --auto-manifest to get its per-build-root facts generated, and the handler suppressed only the JVM entries of the detection result before calling generateAutoManifest. Conda and Bazel survived that, so asking for JVM dynamic SBOM inference generated their manifests too. Run the recursive JVM generation on its own instead, and reach generateAutoManifest only when --auto-manifest was genuinely requested, which also makes the two flags additive rather than one silently forcing the other. Drops the side effect where the forced auto-manifest overrode an explicit `autoManifest: false` in socket.json.
| Back | FazBrowse Home | New Git URL |
Fixes two user-visible problems with --dynamic-sbom-inference, both stemming from where the flag was filed rather than from what it does. See REA-712.
Problem 1 — rejected without --reach
socket scan create . --dynamic-sbom-inference failed with:
The flag lived in reachabilityFlags. #1493 replaced that guard's hand-maintained list with a derivation over every boolean in that object, exempting only reachDisableAnalysisSplitting — so this flag got swept up incidentally. It is not a --reach-* modifier, #1493's description never names it, and no test asserted the new behaviour.
Rather than add a second exemption, this moves the flag into generalFlags. That fixes the guard, stops it printing under "Reachability Options (when --reach is used)", and keeps the next change to the derived guard from re-breaking it. reachabilityFlags now contains only reach* flags, which is what the derivation assumes.
Problem 2 — implying --auto-manifest generated Conda and Bazel manifests
The flag forced autoManifest = true to get its per-build-root facts generated, and handleCreateNewScan then suppressed only the JVM entries of the detection result before calling generateAutoManifest. detected.conda and detected.bazel survived, so a repository containing a Conda environment or a Bazel workspace had those manifests generated as a side effect of asking for JVM dynamic SBOM inference.
Clearing those two booleans as well would have broken the legitimate --auto-manifest --dynamic-sbom-inference combination, where they should be generated. The forcing is the real defect: it destroys the information about whether the user asked for auto-manifest at all. So the one if (autoManifest) block is split into two independent halves under if (autoManifest || reach.dynamicSbomInference):
The existing JVM zeroing stays inside the second half, so the combined case still doesn't resolve cwd's own build root twice and race on the same .socket.facts.json. The sidecar merge, scanTargets union, and excludePaths anchoring are unchanged — they already handled either path contributing or not.
Net effect: --dynamic-sbom-inference generates Gradle, sbt, and Maven and nothing else; the two flags are additive instead of one silently forcing the other.
Other changes
Also drops the side effect where the forced auto-manifest overrode an explicit autoManifest: false in socket.json.
Tests
There were none for this flag outside the --help snapshot, which is why the regression shipped. Added:
Retitled the existing combined-flags test to say so explicitly, and switched the four standalone-path tests from autoManifest: true to false now that the CLI no longer forces the pairing. Help snapshot regenerated: the flag moved from Reachability Options into Options.
pnpm run check passes. Full unit suite green (1728 passed, 2 skipped).
Docs impact
Once this ships, the baseline-scan step in the Gradle reachability guide in SocketDev/docs can collapse from two commands to a single socket scan create . --dynamic-sbom-inference.
Related: #1484 (introduced the flag), #1493 (introduced the regression), #1486 (fail-closed when no JVM build root is found).
Note
Medium Risk
Changes scan-create manifest orchestration and flag validation; behavior shifts for users who relied on implicit --auto-manifest with --dynamic-sbom-inference, but scope is limited to CLI scan/manifest paths with added regression tests.
Overview
--dynamic-sbom-inference is a general socket scan create option again, not a reach-only flag. It no longer trips the “Reachability analysis flags require --reach” guard or appears under reachability help.
Manifest generation is split by intent: recursive Gradle/sbt/Maven facts run when this flag is set; generateAutoManifest (Conda, Bazel, etc.) runs only when --auto-manifest is set. The old behavior that forced autoManifest = true and could pull in non-JVM ecosystems is removed. With both flags, JVM roots are still generated recursively first and duplicate cwd JVM work in auto-manifest is skipped.
socket scan reach drops the wrapper that hid the flag; it still hardcodes dynamicSbomInference: false.
Tests and CHANGELOG document standalone use and the Conda/Bazel side-effect fix.
Reviewed by Cursor Bugbot for commit 9165955. Configure here.