Skip to content

Commit ec2b517

Browse files
committed
Move launch-strategy rationale from the spec resolver to _spawn_coana
The 'why npx, not npm install -g' explanation describes how coana is launched, not how a package spec string is built, so it belongs on _spawn_coana (per review). Leaves _resolve_coana_package_spec with a minimal docstring.
1 parent 9ecceb2 commit ec2b517

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

socketsecurity/core/tools/reachability.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,7 @@ def __init__(self, sdk: socketdev, api_token: str):
5555

5656
def _resolve_coana_package_spec(self, version: Optional[str] = None) -> str:
5757
"""
58-
Resolve the @coana-tech/cli package spec to run with npx.
59-
60-
We pass an exact, versioned spec to npx so it runs a deterministic version from its
61-
own cache (fetching once if absent). We intentionally do NOT ``npm install -g`` here:
62-
that would silently auto-update the engine on every run and mutate the user's global
63-
install. The pinned version rides with the Python CLI release instead, so engine
64-
changes only happen through a standard pip upgrade (advance notice).
58+
Resolve the @coana-tech/cli package spec to run (e.g. '@coana-tech/cli@15.3.24').
6559
6660
Args:
6761
version: Coana CLI version to use.
@@ -313,6 +307,11 @@ def _spawn_coana(
313307
) -> int:
314308
"""Run coana for the given args, returning the process exit code.
315309
310+
We run a pinned, versioned spec via npx and intentionally do NOT ``npm install -g``:
311+
that would silently auto-update the engine on every run and mutate the user's global
312+
install. The pinned version rides with the Python CLI release instead (see
313+
``DEFAULT_COANA_CLI_VERSION``).
314+
316315
Primary path: ``npx --yes --force @coana-tech/cli@<version> ...`` — the exact flags the
317316
Socket Node CLI passes for coana (``--yes`` skips npx's interactive install prompt so
318317
CI runs don't hang).

0 commit comments

Comments
 (0)