From 5896d6cab1463325d4e4775290149033b6ea25d5 Mon Sep 17 00:00:00 2001 From: Nirav Patel Date: Sat, 22 Aug 2026 16:12:35 -0400 Subject: [PATCH] =?UTF-8?q?intake:=20configurable=20chat-only=20opt-out=20?= =?UTF-8?q?prefixes=20(=F0=9F=92=AC,=20chat:)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Posts starting with an opt-out prefix (PULSE_BRIDGE_INTAKE_OPTOUT, case-insensitive) are never turned into a ledger item or kanban task and get no bridge reply. Codex review: no findings. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01YECpkAwQUwgu7NVy91R8fW --- README.md | 7 ++++++- bridge.env | 3 +++ bridge.py | 10 ++++++++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 890954c..aa28863 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,12 @@ launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/ai.shre.pulse-bridge.pli New top-level posts in the `activity` channel written by a human (not the bridge, not agent accounts, not `🤖`-prefixed, not mirror posts carrying a -`ledger:` tag line) become executed, tracked background work: +`ledger:` tag line) become executed, tracked background work. + +**Prefix a post with 💬 (or `chat:`) to just talk** — chat-only posts are +never turned into a ledger item or task and the bridge never replies to +them. The prefix list is configurable via `PULSE_BRIDGE_INTAKE_OPTOUT` +(comma-separated, case-insensitive). 1. **Ledger item** — `shre-items add --kind pipeline --stage queued --tag pulse-intake`, title = first 80 chars of the post, detail = full diff --git a/bridge.env b/bridge.env index 5029cdb..954e918 100644 --- a/bridge.env +++ b/bridge.env @@ -20,3 +20,6 @@ PULSE_BRIDGE_HERMES_DIR=/Users/aibot/.hermes/hermes-agent PULSE_BRIDGE_HERMES_HOME=/Users/aibot/.hermes # comma-separated user_names never ingested (bridge + agent accounts) PULSE_BRIDGE_INTAKE_IGNORE=Ledger,Ellie,AROS +# chat-only prefixes (case-insensitive): posts starting with one of these are +# never turned into work and get no bridge reply +PULSE_BRIDGE_INTAKE_OPTOUT=💬,chat: diff --git a/bridge.py b/bridge.py index e926c7d..0746945 100644 --- a/bridge.py +++ b/bridge.py @@ -72,6 +72,11 @@ HERMES_HOME_DIR = cfg("PULSE_BRIDGE_HERMES_HOME", str(HOME / ".hermes")) INTAKE_IGNORE_USERS = {u.strip().lower() for u in cfg("PULSE_BRIDGE_INTAKE_IGNORE", f"{POSTER_NAME},Ellie,AROS").split(",") if u.strip()} +# chat-only opt-out: posts starting with any of these prefixes (matched +# case-insensitively) are just talk — no ledger item, no task, no comments +INTAKE_OPTOUT_PREFIXES = tuple( + p.strip().lower() for p in + cfg("PULSE_BRIDGE_INTAKE_OPTOUT", "💬,chat:").split(",") if p.strip()) def log(msg: str) -> None: @@ -402,8 +407,9 @@ def intake_ingest(state: dict) -> None: if (ts < cp or m.get("thread_id") or m["id"] in state["intake"] or (m.get("user_name") or "").lower() in INTAKE_IGNORE_USERS or (m.get("user_id") or "").startswith("agent:") - or content.startswith("🤖") or "ledger:" in content): - continue + or content.startswith("🤖") or "ledger:" in content + or content.lower().startswith(INTAKE_OPTOUT_PREFIXES)): + continue # opt-out posts are chat-only: no item, no task, no reply candidates.append(m) for post in sorted(candidates, key=lambda m: int(m["created_at"])): ledger_id = ledger_add_for_post(post)