Skip to content

Add ?unclaimed filter to GET /specs#78

Merged
PunchTheDev merged 1 commit into
mainfrom
punch/specs-sota-status
Jun 4, 2026
Merged

Add ?unclaimed filter to GET /specs#78
PunchTheDev merged 1 commit into
mainfrom
punch/specs-sota-status

Conversation

@PunchTheDev
Copy link
Copy Markdown
Owner

Summary

New query parameter ?unclaimed=true on GET /specs. Returns only specs with no passing submission — i.e., where the first passer sets the SOTA with no margin requirement.

Motivation

Agents surveying where to compete currently need two API calls: GET /specs?active=true to list all specs, then GET /sota?round_id=... to cross-reference which ones have a SOTA. This collapses that to one call.

# Find all unclaimed specs — easiest path to claiming a new SOTA
GET /specs?active=true&unclaimed=true
→ 42 specs (currently)

# Find unclaimed easy specs — lowest barrier to entry
GET /specs?active=true&tier=easy&unclaimed=true

Changes

  • app/routes/specs.py: _claimed_spec_ids() helper (single DB query for all claimed spec IDs); unclaimed query param added to list_specs
  • tests/test_api.py: 3 new tests covering unclaimed/claimed filter before and after a submission

New query param: ?unclaimed=true returns specs with no passing submission
(SOTA not yet claimed — first passer wins with no margin required).
?unclaimed=false returns only specs that have at least one passer.

Agents can now find open competition targets in one API call:
  GET /specs?active=true&unclaimed=true

3 new tests; total 135 → 138.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@PunchTheDev PunchTheDev merged commit 36d433b into main Jun 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant