Reject non-integer bounty fields#246
Closed
nicolatrozzi wants to merge 1 commit into
Closed
Conversation
MolhamHamwi
reviewed
May 25, 2026
Contributor
MolhamHamwi
left a comment
There was a problem hiding this comment.
No blockers found.
Evidence checked:
- Inspected
app/ledger/service.pyand confirmed the new_required_int/_required_positive_inthelpers reject Pythonboolvalues beforeTrue == 1can create or mutate bounty records, while preserving the existing positive-range checks and themax_awards > 1_000cap. - Inspected
tests/test_ledger.pyand confirmed coverage rejects boolean/floatissue_numberandmax_awards, plus booleanbounty_idfor bothpay_bounty()andclose_bounty(). - Verified this is scoped to ledger validation and does not touch payout proof metadata, wallet material, deployment configuration, or public pricing text.
- Ran local validation on PR head
2d0e742: focused new tests ->2 passed; broader ledger/webhook suite ->31 passed; Ruff check passed; Ruff format check already formatted;git diff --check origin/main...HEAD-> clean. - Checked GitHub shows the PR merge state clean and the hosted
Quality, readiness, docs, and image checkscheck successful.
Contributor
Author
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.
Refs #228
Summary
issue_number/max_awardsvalues when creating bounties.bounty_idvalues before directpay_bounty()orclose_bounty()calls can treatTrueas bounty id1.Repro Before Fix
Direct ledger-service calls could pass values such as
issue_number=True,max_awards=True, orbounty_id=True. Because Python booleans are integers (True == 1), those values could create or mutate bounty#1-style records instead of being rejected as malformed input.Verification
./.venv/bin/python -m pytest tests/test_ledger.py::test_create_bounty_rejects_non_integer_issue_number_and_max_awards tests/test_ledger.py::test_bounty_mutations_reject_boolean_bounty_ids -q-> 2 passed./.venv/bin/python -m pytest -q-> 207 passed, 2 warnings./.venv/bin/python -m ruff format --check .-> 37 files already formatted./.venv/bin/python -m ruff check .-> all checks passed./.venv/bin/python -m mypy app-> success./.venv/bin/python scripts/docs_smoke.py-> docs smoke ok./.venv/bin/python scripts/check_agents.py-> AGENTS.md okgit diff --check-> cleanNo secrets, wallet material, private vulnerability details, deployment values, payout details, or MRWK price claims are included.