feat(scan): unit suffixes for reachability timeout/memory limits (1.1.123, Coana 15.5.0)#1369
Merged
Merged
Conversation
….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.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
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.
…-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.
Benjamin Barslev Nielsen (barslev)
approved these changes
Jun 18, 2026
…ty-units # Conflicts: # src/commands/scan/perform-reachability-analysis.test.mts
Coana (@coana-tech/cli) is now the sole validator/parser of the --reach-analysis-timeout and --reach-analysis-memory-limit values, matching the Python CLI. Removes the local grammar mirror (isValid* regex fast-fail) that had already drifted from Coana twice (unit case-sensitivity, and a whitespace gap where Coana trims but the mirror did not). An invalid unit now surfaces as Coana's error instead of a fast local one. Kept the non-validation helpers, which Coana does not model: isOmittedReachValue (empty/zero -> omit the flag so Coana applies its default) and reachMemoryLimitToMb (unit-agnostic default-equivalence for the "requires --reach" guard). The raw string is still forwarded to Coana verbatim.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Adds unit suffixes to the reachability analysis options on
socket scan create --reachandsocket scan reach:--reach-analysis-timeoutacceptss,m,h(e.g.90s,10m,1h)--reach-analysis-memory-limitacceptsMB,GB(e.g.512MB,8GB)Units are case-insensitive. Coana (
@coana-tech/cli) is the sole validator and parser of these values, so the CLI forwards the raw string through verbatim instead of coercing it to a number (both flags changed from meowtype: 'number'to'string') — matching the Socket Python CLI. socket-cli does not pre-validate the grammar, so a single source of truth can't drift; an invalid unit surfaces as Coana's error.Backward compatibility
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— cleanpnpm run check:lint— clean--reachguard (incl. unit-equivalent defaults like8GB/8192MB), help text, fullscan create/scan reach.Related
Part of the cross-CLI "reachability units" effort; validation lives only in Coana:
@coana-tech/cli15.5.0 (merged + published)