feat(runner): evaluate exit-code install-gate policy into artifact verdict - #24
Merged
Conversation
This was referenced Jul 23, 2026
Object-form scanner entries accept a nested gate with blockOnExitCode / warnOnExitCode (int, int list, or "nonzero"). The runner captures user-defined scanner exit codes, evaluates rules after all scanners complete, and records gate: pass|warn|block plus fired gateRules in the artifact. Rules referencing unrequested scanners fail before scanning. Abnormal termination (signal/timeout) never fires exit-code rules.
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: feat(runner): evaluate exit-code install-gate policy into artifact verdict This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
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.
New behavior
Config-defined scanners can turn their process exit code into a recorded
pass,warn, orblockgate verdict. ClawScan writes the verdict to the runartifact and prints it in the human scan summary.
blockOnExitCodeandwarnOnExitCodeaccept one code, a list, ornonzero.timeout statuses are not treated as scanner verdicts.
blockwins overwarn, and no fired rule recordspass.an earlier result.
--scanneroverride drops gate policies for excluded profile scanners.config resolution.
Gate actions are record-only:
blockdoes not stop later scanners or the judge,and it does not change ClawScan's process exit status. Enforcement belongs to
the caller that consumes the artifact or human summary.
Observable contract
blockOnExitCodegate: blockplus onegateRulesentrywarnOnExitCodegate: warnplus onegateRulesentrygate: pass,gateRules: []exitCodeis omitted and no rule firesFor a single run, inspect
gateandgateRules. Batch artifacts exposeruns[].gateandruns[].gateRules; benchmark artifacts exposecases[].run.gateandcases[].run.gateRules. The human scan summaryaggregates the strongest batch action.
How to verify
Create a config-defined scanner that emits JSON and exits 3:
Run it without Docker or credentials:
The artifact contains:
{ "gate": "block", "gateRules": [ { "scanner": "demo-scanner", "rule": "blockOnExitCode", "exitCode": 3, "action": "block" } ] }Running without
--jsonprints:The command still exits 0 because this PR records but does not enforce the
verdict.
Checks
go test -count=1 ./internal/runner -skip 'TestResolveTargetClassifiesPlugin(Directory|ManifestFile)$'passed.go vet ./...passed.go build ./...passed.make docs-sitepassed in an isolated validation copy.equivalent
/var/...and/private/var/...paths; the affected productionand test files are unchanged from
main.