From 3bcd21efaaaa391e675b9d19c441e08d1537b03b Mon Sep 17 00:00:00 2001 From: abhay-codes07 Date: Sat, 5 Sep 2026 17:06:35 +0530 Subject: [PATCH] fix(policy): quote_amount_valid detail only on failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A passing check was rendering the failure message ('below the ₹1 minimum') in the console's checkout policy-check list. Show the detail only when the check fails, like the other conditional checks. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01BLrj9TWybDCNw1mWxZgAks --- bazaar/trust/policy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bazaar/trust/policy.py b/bazaar/trust/policy.py index 3e26703..7fd9030 100644 --- a/bazaar/trust/policy.py +++ b/bazaar/trust/policy.py @@ -67,7 +67,7 @@ def check_checkout(self, m: Merchant, quote: Quote, agent_keyid: str, grant_id: cs.append(Check(name="kill_switch_off", passed=not pol.kill_switch, detail="merchant disabled agent" if pol.kill_switch else "")) cs.append(Check(name="quote_fresh", passed=now <= quote.valid_until, detail="quote expired" if now > quote.valid_until else "")) cs.append(Check(name="quote_merchant_matches", passed=quote.merchant_id == m.merchant_id)) - cs.append(Check(name="quote_amount_valid", passed=quote.total_paise >= 100, detail=f"₹{quote.total_paise / 100:.2f} below the ₹1 minimum a payment link accepts")) + cs.append(Check(name="quote_amount_valid", passed=quote.total_paise >= 100, detail="" if quote.total_paise >= 100 else f"₹{quote.total_paise / 100:.2f} below the ₹1 minimum a payment link accepts")) ident = self.registry.get(agent_keyid) cs.append(Check(name="agent_registered", passed=ident is not None and not ident.revoked, detail=agent_keyid or "unsigned"))