From 93f989c82115ea69940cfdfd1702185488bf2c46 Mon Sep 17 00:00:00 2001 From: pyr0ball Date: Tue, 14 Apr 2026 11:44:53 -0700 Subject: [PATCH] feat: add llm_query_builder tier gate (paid+) to tiers.py and SessionFeatures --- api/cloud_session.py | 2 ++ app/tiers.py | 1 + tests/test_tiers.py | 10 ++++++++++ 3 files changed, 13 insertions(+) diff --git a/api/cloud_session.py b/api/cloud_session.py index ab97abc..99d9de6 100644 --- a/api/cloud_session.py +++ b/api/cloud_session.py @@ -69,6 +69,7 @@ class SessionFeatures: photo_analysis: bool shared_scammer_db: bool shared_image_db: bool + llm_query_builder: bool def compute_features(tier: str) -> SessionFeatures: @@ -85,6 +86,7 @@ def compute_features(tier: str) -> SessionFeatures: photo_analysis=paid_plus, shared_scammer_db=paid_plus, shared_image_db=paid_plus, + llm_query_builder=paid_plus, ) diff --git a/app/tiers.py b/app/tiers.py index d41eafd..29b16b3 100644 --- a/app/tiers.py +++ b/app/tiers.py @@ -26,6 +26,7 @@ FEATURES: dict[str, str] = { "reverse_image_search": "paid", "ebay_oauth": "paid", # full trust scores via eBay Trading API "background_monitoring": "paid", # limited at Paid; see LIMITS below + "llm_query_builder": "paid", # inline natural-language → filter translator # Premium tier "auto_bidding": "premium", diff --git a/tests/test_tiers.py b/tests/test_tiers.py index 18c0162..455968e 100644 --- a/tests/test_tiers.py +++ b/tests/test_tiers.py @@ -22,3 +22,13 @@ def test_saved_searches_are_free(): # Ungated: retention feature — friction cost outweighs gate value (see tiers.py) assert can_use("saved_searches", tier="free") is True assert can_use("saved_searches", tier="paid") is True + + +def test_llm_query_builder_is_paid(): + assert can_use("llm_query_builder", tier="free") is False + assert can_use("llm_query_builder", tier="paid") is True + + +def test_llm_query_builder_local_vision_does_not_unlock(): + # local vision unlocks photo features only, not LLM query builder + assert can_use("llm_query_builder", tier="free", has_local_vision=True) is False