Skip to content

feat(scan): unit suffixes for reachability timeout/memory limits (1.1.123, Coana 15.5.0)#1369

Open
Martin Torp (mtorp) wants to merge 2 commits into
v1.xfrom
martin/cli-reachability-units
Open

feat(scan): unit suffixes for reachability timeout/memory limits (1.1.123, Coana 15.5.0)#1369
Martin Torp (mtorp) wants to merge 2 commits into
v1.xfrom
martin/cli-reachability-units

Conversation

@mtorp

@mtorp Martin Torp (mtorp) commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds unit suffixes to the reachability analysis options on socket scan create --reach and socket scan reach:

  • --reach-analysis-timeout accepts s, m, h (e.g. 90s, 10m, 1h)
  • --reach-analysis-memory-limit accepts MB, GB (e.g. 512MB, 8GB)

Units are case-insensitive. Coana (@coana-tech/cli) is the canonical parser, so the CLI now forwards the raw value through verbatim instead of coercing it to a number (both flags changed from meow type: 'number' to 'string'). A thin local validator (reachability-units.mts) rejects malformed values fast, before the Coana binary is spawned.

Backward compatibility

  • Bare numbers still work (seconds / MB) but are no longer documented.
  • Empty or zero-magnitude values are omitted when forwarding, so Coana applies its own defaults — preserving the prior numeric-0 "use default" sentinel.

Coana bump

Bumps the bundled Coana CLI to 15.5.0, whose parser understands these unit suffixes (the feature is inert on older Coana, which predates the parser). Package version bumped to 1.1.123 with a changelog entry.

Testing

  • pnpm run check:tsc — clean
  • pnpm run check:lint — clean
  • Reachability scan suites pass (grammar validation incl. case-insensitivity, verbatim forwarding, empty/zero → omit, help text, full scan create / scan reach).

Related

Part of the cross-CLI "reachability units" effort:

  • Docs: SocketDev/docs#32
  • Coana parser: @coana-tech/cli 15.5.0 (merged + published)
  • Socket Python CLI: updated in parallel

….123, Coana 15.5.0)

--reach-analysis-timeout and --reach-analysis-memory-limit now accept unit
suffixes (s/m/h for duration, MB/GB for memory, case-insensitive). Coana owns
the canonical parsing, so the CLI forwards the raw string verbatim instead of
coercing to a number. A thin local validator gives fast errors before the Coana
binary is spawned.

Empty or zero-magnitude values are omitted when forwarding so Coana applies its
own defaults, preserving the prior numeric-0 sentinel. Bare numbers keep working
but are no longer documented. Bumps the bundled Coana CLI to 15.5.0, whose parser
handles these units.
@socket-security

socket-security Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​coana-tech/​cli@​15.5.0961008098100

View full report

@socket-security-staging

socket-security-staging Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​coana-tech/​cli@​15.5.0971008098100

View full report

@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 1 potential issue.

Fix All in Cursor

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

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

Reviewed by Cursor Bugbot for commit bd1d761. Configure here.

message: 'Reachability analysis flags require --reach to be enabled',
fail: 'add --reach flag to use --reach-* options',
},
{

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Timeout zero sentinel breaks scan create

Medium Severity

The scan create command incorrectly treats default-equivalent values for --reach-analysis-timeout and --reach-analysis-memory-limit as non-default. Following the type change to string, inputs like "0", "0s", "8GB", or "8192MB" are flagged as requiring --reach, even though they represent the default behavior, causing an error when --reach is not explicitly provided.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit bd1d761. Configure here.

…-reach guard

The "reachability flags require --reach" guard compared the raw flag strings to
the default string, so unit-equivalent inputs were wrongly flagged as non-default
and rejected without --reach: 8GB / 8192MB (= the 8192MB default) and the
zero/omit timeout sentinel 0 / 0s. The latter was a regression from the
number→string change (numeric 0 used to equal the numeric default).

Compare by resolved magnitude instead: reachMemoryLimitToMb normalizes
8192/8192MB/8GB to 8192, and the timeout uses the omit sentinel so any zero
counts as default.
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