Skip to content

fix(scan): setup/fetch exit 2; reject VERSION/tag_name that leaves the download path - #53

Open
sheel-PBM wants to merge 5 commits into
trustabl:mainfrom
sheel-PBM:fix/setup-errors-exit-2
Open

fix(scan): setup/fetch exit 2; reject VERSION/tag_name that leaves the download path#53
sheel-PBM wants to merge 5 commits into
trustabl:mainfrom
sheel-PBM:fix/setup-errors-exit-2

Conversation

@sheel-PBM

@sheel-PBM sheel-PBM commented Aug 24, 2026

Copy link
Copy Markdown

Summary

Setup/fetch failures exit 2. That includes an unresolved VERSION, unsupported OS/arch, and a VERSION or /releases/latest tag_name that is not a single path segment (it would rewrite /releases/download/${VER}/${ASSET} and the local -o path). Not #3 (native remap after a run). Not #7 (checksum stays exit 1).

docs/EVALUATION.md treats exit 1 as a gate result and exit 2 as a scanner/I/O failure. Failing to resolve VERSION currently exits 1, so a pipeline cannot tell a dead GitHub lookup from a repo that has findings.

This remaps pre-scan setup failures that #3 does not cover (#3 remaps the native trustabl exit after a run):

Setup failure Wrapper exit
Could not resolve VERSION 2 (was 1)
Unsupported OS / arch 2 (was 1)
VERSION / tag_name with /, .., whitespace, :, or @ 2 (was: interpolated into the download URL and -o path)

A pin or a /releases/latest tag_name that is not a single path segment would change /releases/download/${VER}/${ASSET} and the local tarball filename. Checksum mismatch stays at exit 1 so this does not collide with the fail-closed / macOS checksum PRs (#7, #9, #12, #55).

Test plan

  • bash -n scan/trustabl-scan.sh
  • shellcheck -S error on *.sh
  • bash test/test-setup-exit.sh (stubbed curl, no network: unresolved VERSION, slash pin, and slash tag_name all exit 2; no binary fetch)
  • Pin a real VERSION: findings still exit 0/1 as before

sheel-PBM and others added 3 commits August 24, 2026 16:15
docs/EVALUATION.md says exit 1 is a gate result and exit 2 is a
scanner/I/O failure. Resolving the release, an unsupported platform,
or a checksum mismatch is the latter — not a findings gate.

Co-authored-by: Cursor <cursoragent@cursor.com>
Checksum mismatch is already in several fail-closed PRs. Keep this
change to setup/I/O that trustabl#3 does not cover, and add an offline test.

Co-authored-by: Cursor <cursoragent@cursor.com>
@sheel-PBM sheel-PBM changed the title fix(scan): exit 2 when the binary cannot be fetched or verified fix(scan): exit 2 when VERSION cannot be resolved Aug 25, 2026
@sheel-PBM

Copy link
Copy Markdown
Author

@sairenchristianbuerano @trustabl Ready for review. Distinct from #3 (this remaps pre-scan setup failures; #3 remaps the native binary). Local bash -n, shellcheck -S error, and test/test-setup-exit.sh pass.

Lint is action_required on the first-time fork workflow (run 32799882278) — not a lint failure. Approving that run unblocks the check.

@sheel-PBM sheel-PBM changed the title fix(scan): exit 2 when VERSION cannot be resolved fix(scan): setup/fetch exit 2; reject VERSION/tag_name that leaves the download path Aug 25, 2026
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