Repository navigation
Use a distinct exit code (3) when a run stops at --max-cost - #64
Merged
Merged
Conversation
3 tasks done
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.
Closes #48
Why
--fail-onand--max-costboth exited2, so CI could not tell a findings-policy failure from a budget overrun without parsing JSON.What
EXIT_COST_EXCEEDED = 3incli.py; the exit code is now resolved once and reused for both the--jsondocument (exit_code) andtyper.Exit.1> cost gate3> findings gate2>0. If both gates trip,3wins so the budget overrun is visible; the JSON still carries both gate verdicts.--helpdocstring anddocs/REFERENCE.md(flag table and exit-code paragraph) updated.Tests
test_max_cost_trips_when_summed_spend_exceeds_capnow asserts exit3andexit_code == 3in the JSON. It failed before the change (exit2) and passes after.Verification
PYTHONPATH=src python -m pytest tests/test_cli.py -p no:llmsectest: 55 passed. (The editable install timed out onlitellmhere, and a global pytest plugin that is not installed had to be disabled.)ruff check: no new violations in the changed files vsorigin/main(existing ones remain).pytest testswas not run for this PR.Note
This changes the exit code existing users get from
--max-cost, from2to3. If you would rather keep2and add a separate signal, I can rework it.