Add a clamp(value, low, high) function to src/calculator.py that returns value bounded by low and high, and raises ValueError when low > high. Follow the conventions in CLAUDE.md.
Acceptance criteria
The ticket objective is satisfied: Add a clamp function to the calculator
Commits
Commit
Summary
Node
8605a8c5969e
test(sveta): Write clamp tests
-
c7f0712d1246
feat(nadia): Implement clamp function
-
Run
Cost: 0.0017 USD · Nodes: 6 · Verification: make verify
## What was built
Add a `clamp(value, low, high)` function to src/calculator.py that returns value bounded by low and high, and raises ValueError when low > high. Follow the conventions in CLAUDE.md.
## Acceptance criteria
- The ticket objective is satisfied: Add a clamp function to the calculator
## Commits
| Commit | Summary | Node |
|---|---|---|
| `8605a8c5969e` | test(sveta): Write clamp tests | `-` |
| `c7f0712d1246` | feat(nadia): Implement clamp function | `-` |
## Run
Cost: 0.0017 USD · Nodes: 6 · Verification: make verify
Closes #7
**Outcome:** done
**Changed:** src/calculator.py:11-18
**Verified by:** python3 -m compileall -q src — passed; python3 -c with five acceptance assertions — passed. make verify fails because tests/ directory does not exist.
**Findings:** clamp(value: int, low: int, high: int) -> int added at src/calculator.py:11 with no docstrings or comments. File header at src/calculator.py:1 is present. All functions use full int type annotations.
**Open:** Test writer (sveta) should create tests/ directory and add unit tests for clamp.
**Confidence:** high
Typosaurus-Run: 5b5c36bf38254bf4bfcdbde317991a5a
Typosaurus-Node: bf41377d70c446b1b80b9e058fe81fb8
Typosaurus-Agent: @nadia
Refs: #7
Outcome: done
Changed: tests/__init__.py:1, tests/test_calculator.py:1-86
Verified by: `make verify` — exit 0, "verification passed", Ran 16 tests in 0.001s, OK
Findings: tests/ directory created at ./tests/ with __init__.py (header only) and test_calculator.py (16 tests for clamp).
Findings: All 16 clamp tests pass under `make verify`: value below low, above high, in range, equals low, equals high, low>high ValueError, negative values, float below/above/in-range/equals-boundary, float low>high ValueError, large values, -inf/inf boundaries, and NaN.
Findings: clamp is typed as (value: int, low: int, high: int) -> int; float and inf/NaN tests pass because Python does not enforce type hints at runtime.
Open: none
Confidence: high - all 16 tests pass, all acceptance criteria covered, make verify passes
Typosaurus-Run: 5b5c36bf38254bf4bfcdbde317991a5a
Typosaurus-Node: 56f03705c3d64023ba102d3aa3169ef2
Typosaurus-Agent: @sveta
Refs: #7
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What was built
Add a
clamp(value, low, high)function to src/calculator.py that returns value bounded by low and high, and raises ValueError when low > high. Follow the conventions in CLAUDE.md.Acceptance criteria
Commits
8605a8c5969e-c7f0712d1246-Run
Cost: 0.0017 USD · Nodes: 6 · Verification: make verify
Closes #7
Please rebbbase this ticket again!!
Please add a lot of tests.
Pull request closed