Skip to content

refactor(cli): share mount flag parsing with profile overrides - #219

Merged
vincentkoc merged 1 commit into
mainfrom
refactor/mount-flag-parser
Nov 24, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
refactor/mount-flag-parser

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

Summary

Maintainers changing --sandbox-mount had to keep two copies of the same suffix and error handling in sync. Direct scans and profile overrides now use the runner's existing parser.

Scope

CLI flag parsing only. Profiles still own YAML decoding and path validation. The code that starts Docker and constructs the mount arguments is unchanged.

Security / Trust Impact

Read-only defaults, writable suffixes, repeated-path precedence and path validation retain their existing behavior.

Verification

Compared the baseline and candidate CLI binaries with fixture-backed scanner evidence. All 16 comparisons matched, covering direct and explicit-profile invocations, plain paths, both writable suffixes, literal colons, repeated paths, missing paths, relative paths and missing writable path prefixes. Successful scans reported the expected sandbox mounts. Rejected inputs returned matching exit codes and error text.

  • go test -count=1 -p=1 ./internal/runner ./internal/profiles -run 'SandboxMount|SandboxOverrides'
  • go test -count=1 -p=1 ./...
  • go vet ./...
  • go run ./cmd/clawscan --help

The P0–P3 autoreview reported no actionable findings. The CLI comparison used recorded scanner output and did not need a Docker daemon.

@vincentkoc
vincentkoc marked this pull request as ready for review November 24, 2026 10:01
@clawsweeper

clawsweeper Bot commented Nov 24, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@vincentkoc
vincentkoc requested review from a team and Patrick-Erichsen as code owners November 24, 2026 10:01
@vincentkoc
vincentkoc merged commit 965eb4a into main Nov 24, 2026
11 of 12 checks passed
@vincentkoc
vincentkoc deleted the refactor/mount-flag-parser branch November 24, 2026 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant