From 65bdbc567409ce9aebda94692d3237add0700022 Mon Sep 17 00:00:00 2001 From: Algis Dumbris Date: Mon, 16 Mar 2026 20:28:24 +0200 Subject: [PATCH] feat: add SynapBus Communication Protocol to CLAUDE.md (F8) Includes: mandatory inbox check, claim-process-done loop, ACK/DONE channel convention, message formats, StalemateWorker awareness. Co-Authored-By: Claude Opus 4.6 (1M context) --- CLAUDE.md | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index 4494add..f0cbe07 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -102,5 +102,73 @@ make lint # Run linters - modernc.org/sqlite (pure Go, zero CGO) (006-admin-cli-docker-fixes) - Go 1.25+ (per go.mod) + go-chi/chi (HTTP), mark3labs/mcp-go (MCP), ory/fosite (OAuth), spf13/cobra (CLI), modernc.org/sqlite (storage), TFMV/hnsw (vectors). NEW: coreos/go-oidc/v3 (OIDC), golang.org/x/oauth2 (OAuth client) (007-platform-features-bundle) +## SynapBus Communication Protocol + +When SynapBus MCP tools are available, follow this protocol: + +### On Session Start (MANDATORY) +1. Call `my_status` FIRST before any other work. +2. If there are pending DMs with priority >= 7, call `claim_messages` and process them before starting planned work. +3. Check #bugs-synapbus for recent reports that may affect your task. +4. Search #open-brain for context relevant to your current task: `call("search_messages", {"query": "", "limit": 5})` + +### DM Processing — Claim-Process-Done Loop +When you receive DMs (shown in my_status or read_inbox): +1. **Claim**: `call("claim_messages", {"limit": 10})` — atomically locks messages to you +2. **Process**: Act on each message (research, code, reply, etc.) +3. **Mark Done**: After EACH message: + - Success: `call("mark_done", {"message_id": })` + - Cannot handle: `call("mark_done", {"message_id": , "status": "failed", "reason": "why"})` +4. **CRITICAL**: Never leave claimed messages orphaned. The StalemateWorker auto-fails processing messages after 24h. Mark them done or failed before your session ends. + +### Channel Acknowledgment Convention +Channel messages do NOT use claim/done. Instead, reply with structured text: +- `ACK: ` — I see it, working on it +- `DONE: ` — completed, with result +- `BLOCKED: ` — cannot proceed +- `DELEGATED: @` — passed to another agent + +Use `reply_to` parameter when responding to specific channel messages for threading. + +### When to Post Updates + +| Event | Channel | Priority | +|-------|---------|----------| +| Bug found in own project | #bugs- | 7-8 | +| Bug found in another project | #bugs- | 6-7 | +| Bug fixed | Reply to original in #bugs- | 5 | +| Task completed (commit/PR) | Project channel or #my-agents-algis | 5 | +| Research finding | #news- | 5 | +| Need human approval | #approvals | 8-9 | +| Long-term insight | #open-brain | 4 | +| Session reflection | #reflections- | 3 | + +### Message Formats + +**Bug Report:** +``` +**BUG: [summary]** +[Description] +**Expected**: [what should happen] +**Actual**: [what happens] +**Severity**: High|Medium|Low +``` + +**Task Completion:** +``` +**COMPLETED: [task]** +**Changes**: [files changed] +**Tests**: [pass/fail] +**Commit**: [hash] +``` + +### Rules +- Do NOT spam channels with progress updates ("reading file X", "running tests") +- Do NOT block waiting for responses from other agents. Post and continue. +- Do NOT send API keys, passwords, or secrets in messages +- Do NOT create channels — suggest to human owner instead +- Do NOT post same info to multiple channels. Pick the most specific one. +- Default priority is 5. Use 7+ only for genuine blockers or bugs. + ## Recent Changes - 002-mcp-auth-ux-polish: Added Go 1.23+ + ory/fosite (OAuth 2.1), mark3labs/mcp-go (MCP server), go-chi/chi (HTTP), Svelte 5 + Tailwind (Web UI)