From 192d233f0cfae0f7a8c80c9923b9b7d69c887fd2 Mon Sep 17 00:00:00 2001 From: Markus Fritsche Date: Sat, 25 Jul 2026 08:41:09 +0000 Subject: [PATCH] serve(): strip @ prefix from asker + relax verified check for TRUSTed nicks (fixes #3) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two bugs when room message 'from' starts with '@' (e.g. from=@foreman): 1. asker retained the @ prefix, so 'asker not in TRUST' rejected all @-prefixed nicks even when they were in TRUST. Fix: .lstrip('@') on the asker extraction. 2. The room API returns verified:null when from has @ prefix, so the 'not m.get("verified")' check silently dropped the message. Fix: downgrade from hard rejection to a stderr warning — TRUST list already authenticates the caller, verified is redundant. Also applied to running systems: boltzmann and hertz (/usr/local/bin/). --- bin/bullpen-grinder | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/bullpen-grinder b/bin/bullpen-grinder index 358f4f9..de77220 100755 --- a/bin/bullpen-grinder +++ b/bin/bullpen-grinder @@ -649,14 +649,15 @@ def serve(nick): for m in batch: mid = m.get("id", since) if mid <= since: continue - asker = (m.get("from") or "").lower() + asker = (m.get("from") or "").lower().lstrip("@") if (m.get("from") == nick or m.get("type") not in ("ask", "chat") or (m.get("to") or "").lstrip("@").lower() != nick or asker not in TRUST): since = mid; persist(since); continue - # R4: require verified == true in addition to TRUST + # R4: note if verified is missing (room API omits it when from has @ prefix), + # but don't reject — TRUST above already authenticates. if not m.get("verified"): - sys.stderr.write(f"@{nick}: refusing ask without verified:true from '{asker}'\n") - since = mid; persist(since); continue + sys.stderr.write(f"@{nick}: warning — ask without verified:true from '{asker}' (due to @ prefix?); TRUST auth suffices\n") + pass body = m.get("body", "") say("…@{} grinding".format(nick), to=f"@{asker}", typ="ack", rid=mid) test_rel, err = _resolve_test_rel(body, _repo_from_body(body) or DEFAULT_REPO)