From 24e02621dfb2b997031ee7fba71d45f180c8df63 Mon Sep 17 00:00:00 2001 From: Chaim Date: Tue, 30 Jun 2026 10:20:47 +0000 Subject: [PATCH] =?UTF-8?q?docs(heartbeat):=20comment-recheck=20gate=20bef?= =?UTF-8?q?ore=20done=20=E2=80=94=20prevent=20dropped=20chair=20comments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Belt-and-suspenders to the plugin sweep (plugin-legal-ai #3). Comments that arrive mid-run aren't re-read automatically — an agent reads comments once at run start (§2), so a chair comment that lands after that point and before the run closes the issue is never seen. That is exactly how a chair comment on CMP-190 (2026-06-30) was dropped. Adds a mandatory gate to HEARTBEAT §4ב: before PATCH status=done, re-read comments and compare to the run-start list. If a new unaddressed chair comment exists — do not close. Either handle it (and record a comment) or, if it widens scope, keep the issue open and hand back to the CEO (§4ג). Never mark done while a chair comment waits unanswered. The plugin sweep catches orphaned comments within ~2 min; this gate prevents the drop at the source. Refs legal-ai #164. Co-Authored-By: Claude Opus 4.8 (1M context) --- .claude/agents/HEARTBEAT.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.claude/agents/HEARTBEAT.md b/.claude/agents/HEARTBEAT.md index 3e7147c..b129158 100644 --- a/.claude/agents/HEARTBEAT.md +++ b/.claude/agents/HEARTBEAT.md @@ -171,6 +171,12 @@ FULL_PATH="/home/chaim/.paperclip/instances/default/data/storage/$CONTENT_PATH" **אסור** `done` עם כשל שלא טופל. אם משהו נכשל → `blocked` + comment עם פירוט. +> **⚠️ שער קריאת-הערות לפני סגירה (חובה).** הערות שנכנסות **תוך-כדי ריצה** אינן נקראות אוטומטית — קראת comments פעם אחת בתחילת הריצה (§2). **לפני** `PATCH status=done`, קרא שוב את ה-comments והשווה לרשימה שראית בתחילת הריצה: +> ```bash +> ~/legal-ai/scripts/pc.sh GET "/api/issues/{issue-id}/comments" +> ``` +> אם נכנסה **הערת-משתמש חדשה (היו"ר)** שעדיין לא טיפלת בה — **אל תסגור**. או שתטפל בה עכשיו (אם בתחום-המשימה שלך) ותתעד ב-comment, או — אם היא מרחיבה/משנה את ההיקף — **השאר את ה-issue פתוח והעבר ל-CEO** (§4ג) עם reason שמציין את ההערה החדשה, כדי שינתב. **לעולם אל תסמן `done` בעוד הערת-יו"ר ממתינה ללא-מענה** — כך הערה "נופלת". (גיבוי-מערכת: sweep `route-pending-comments` בפלאגין תופס הערות-יתום תוך ~2 דק', אך השער הזה מונע את הנפילה במקור. רקע: legal-ai #164.) + ### §4ג. wake CEO לפי חברה **⚠️ CEO שונה לכל חברה** (ראה §1). UUID hardcoded **אסור** — תמיד דרך `$PAPERCLIP_COMPANY_ID`: